Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello PBI community,
I am so stuck.
I have an overtime model which contains the following tables
All visible columns are keys.
I am having a lot of trouble getting a count of active team members that are in table 2 but not table 1 (the ones that did not work overtime), especially when grouped by their respective division. I have managed to create a measure that works as a stand alone calculation with this code...
TEST =
VAR A = MIN('DimDate'[Date])
VAR B =
CALCULATETABLE(
VALUES('DimTeamMember'[EmployeeSK]),
CROSSFILTER('DimTeamMember'[EmployeeSK],'DimTeamMemberList'[EmployeeSK], NONE),
'DimTeamMember'[IsActive] = "Yes",
OR('DimTeamMember'[TerminationDate] >= a, 'DimTeamMember'[TerminationDate] = blank())
)
VAR C = CALCULATETABLE(VALUES('FactOvertime'[EmployeeSK]))
VAR D = COUNTROWS( DISTINCT(EXCEPT(B, C)))
RETURN D
but this measure falls short as I cant break down this total by division. here is an example.
I believe the way the model relationships are set up is necessary for other aspects of reporting because the historical team member dimension is a special case with many attributes.
Is there a way to solve this with dax?
Solved! Go to Solution.
Hi @gftx90 ,
I created a sample pbix file(see attachment), please check whether that is what you want. I updated the formula of your measure [TEST] as below:
TEST =
VAR _curdate =
SELECTEDVALUE ( 'DimDate'[Date] )
VAR _tmembers =
CALCULATETABLE (
VALUES ( 'DimTeamMember'[EmployeeSK] ),
FILTER (
'DimTeamMember',
'DimTeamMember'[IsActive] = "Yes"
&& (
ISBLANK ( 'DimTeamMember'[TerminationDate] )
|| IF (
NOT ( ISBLANK ( 'DimTeamMember'[TerminationDate] ) ),
'DimTeamMember'[TerminationDate] >= _curdate
)
)
)
)
VAR _otmembers =
CALCULATETABLE ( VALUES ( 'FactOvertime'[EmployeeSK] ) )
VAR _ncount =
COUNTROWS ( DISTINCT ( EXCEPT ( _tmembers, _otmembers ) ) )
RETURN
_ncount
Best Regards
Hi @gftx90 ,
I created a sample pbix file(see attachment), please check whether that is what you want. I updated the formula of your measure [TEST] as below:
TEST =
VAR _curdate =
SELECTEDVALUE ( 'DimDate'[Date] )
VAR _tmembers =
CALCULATETABLE (
VALUES ( 'DimTeamMember'[EmployeeSK] ),
FILTER (
'DimTeamMember',
'DimTeamMember'[IsActive] = "Yes"
&& (
ISBLANK ( 'DimTeamMember'[TerminationDate] )
|| IF (
NOT ( ISBLANK ( 'DimTeamMember'[TerminationDate] ) ),
'DimTeamMember'[TerminationDate] >= _curdate
)
)
)
)
VAR _otmembers =
CALCULATETABLE ( VALUES ( 'FactOvertime'[EmployeeSK] ) )
VAR _ncount =
COUNTROWS ( DISTINCT ( EXCEPT ( _tmembers, _otmembers ) ) )
RETURN
_ncount
Best Regards
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 13 | |
| 10 | |
| 8 |