0

A little bit of a newbie with Power BI DAX code. I have a log database that has two tables, Connections, and Employees. The two tables have a one-to-many relationship on sEmailAddress. The following DAX code that creates metrics works well in that I get a count of my employees that connect via VPN and I can get a list of those that connect via VPN

sVPN Count = CALCULATE ( DISTINCTCOUNT ( Connections[sEmailAddress] ), FILTER ( Connections, Connections[sTarget] = "VPN" ), FILTER ( Connections, Connections[sEvent] = "User Logon" ) ) 
sVPN Users = CALCULATETABLE ( DISTINCT ( Connections[sEmailAddress] ), FILTER ( Connections, Connections[sTarget] = "VPN" ), FILTER ( Connections, Connections[sEvent] = "User Logon" ) ) 

I am trying to find a method that can provide me a list of employees that DON'T login on any given day.

2 Answers 2

1

You are created a Calculated Column/ Measure, but you put calculation that is returning a table of value. If you need only a list of email, then put your code to "New Table". Then just add this newly created column to your visual.

If you need to show this with additional data, then you can create a column with a flag (1/0) based on your relationship.

pseudo using IF

Flag = IF(isblank('left side of relationship'), 1,0) 
Sign up to request clarification or add additional context in comments.

Comments

1

One approach would be to add a calculated column to your employee table where you use the [sVPN Count] measure you've already defined. Then you can identify the employees who haven't logged in by seeing which rows have blank or zero values in that column.

As msta42a notes, a measure can only return a single value, not a table. (This is the reason for the error you are getting.)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.