Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abzt
New Member

Dax - Show difference between two related columns in different tables

I have two columns of data for Emplolyees - linked via Employee ID

 

Table 1 - Shows the employeees who have booked on for a particular date range (Emp ID/ First Name/ Last Name/Work Date/Hours)

 

Tabel 2 - Is the listing of ALL company employees (Emp ID/ First Name/ Last Name)

 

Outcome - I am trying to get an output of the employees from Table 2 that do not feature in the Table 1 lisitng for the chosen sliced date range

1 ACCEPTED SOLUTION

Create a measure like

Emp is visible =
IF (
    SELECTEDVALUE ( 'Table 2'[Employee ID] )
        IN EXCEPT ( VALUES ( 'Table 2'[Employee ID] ), VALUES ( 'Table 1'[Employee ID] ) ),
    1,
    0
)

and add that as a visual level filter to only show when the value is 1

View solution in original post

8 REPLIES 8
abzt
New Member

Thank you very much I now have the desired results

johnt75
Super User
Super User

Use the columns from table 2 in the visual and add a filter so that 'Table 1'[Employee ID] is blank.

Thank you for your response, following those steps however there are no blank values displaying in the filter listing for the visual as an option or returning if I choose "is blank" , I know I am expecting 40 records

You could create a measure as COUNTROWS('Table 1') and filter for values >= 1.

I'm not sure what Im doing wrong but I can't get to a list of those who have not booked on, the measure only shows those who have booked again i cant get to the blanks

Just for debugging try creating a new table like

Tmp table =
CALCULATETABLE (
    EXCEPT ( VALUES ( 'Table 2'[Employee ID] ), VALUES ( 'Table 1'[Employee ID] ) ),
    DATESBETWEEN ( 'Date'[Date], DATE ( 2023, 1, 1 ), DATE ( 2023, 1, 31 ) )
)

replacing the start and end dates with what you have chosen from the slicer.

That seems to display the values I am looking for on the non-bookers, how can I incorporate that into the report?

Create a measure like

Emp is visible =
IF (
    SELECTEDVALUE ( 'Table 2'[Employee ID] )
        IN EXCEPT ( VALUES ( 'Table 2'[Employee ID] ), VALUES ( 'Table 1'[Employee ID] ) ),
    1,
    0
)

and add that as a visual level filter to only show when the value is 1

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.