The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I’m running a training program that consists of 5 groups of classes.
I need to check if an employee completed that group of classes between 1/1/2024 and 4/7/2024
I suspect I need to do some type of group by (probably nested), but I can’t figure it out.
This example is just one group of classes.
Completed Example | |||
EmployeeID | Class ID | Completed Date | Group Status |
1234 | A | 1/1/2024 | Completed |
1234 | B | 1/10/2024 | Completed |
1234 | C | 2/20/2024 | Completed |
1234 | D | 4/7/2024 | Completed |
Incomplete Example | |||
EmployeeID | Class ID | Completed Date | Status |
1234 | A | 1/1/2024 | Incomplete |
1234 | B | 1/10/2024 | Incomplete |
1234 | C | 2/20/2024 | Incomplete |
1234 | D | 4/15/2024 | Incomplete |
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check below pictures and the attached pbix file.
Status measure: =
VAR _selectedclasses =
COUNTROWS (
CALCULATETABLE (
SUMMARIZE ( Data, Class[Class ID] ),
REMOVEFILTERS ( 'Calendar'[Date] )
)
)
VAR _completedclasses =
COUNTROWS ( SUMMARIZE ( Data, Class[Class ID] ) )
RETURN
IF (
HASONEVALUE ( Employee[EmployeeID] ),
IF ( _selectedclasses > _completedclasses, "Incomplete", "Complete" )
)
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check below pictures and the attached pbix file.
Status measure: =
VAR _selectedclasses =
COUNTROWS (
CALCULATETABLE (
SUMMARIZE ( Data, Class[Class ID] ),
REMOVEFILTERS ( 'Calendar'[Date] )
)
)
VAR _completedclasses =
COUNTROWS ( SUMMARIZE ( Data, Class[Class ID] ) )
RETURN
IF (
HASONEVALUE ( Employee[EmployeeID] ),
IF ( _selectedclasses > _completedclasses, "Incomplete", "Complete" )
)
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |