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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
amtrakrob
Frequent Visitor

Count training records completed in a date range.

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   
EmployeeIDClass IDCompleted DateGroup Status
1234A1/1/2024Completed
1234B1/10/2024Completed
1234C2/20/2024Completed
1234D4/7/2024Completed
    
Incomplete Example   
EmployeeIDClass IDCompleted DateStatus
1234A1/1/2024Incomplete
1234B1/10/2024Incomplete
1234C2/20/2024Incomplete
1234D4/15/2024Incomplete
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1714101368131.png

 

 

Jihwan_Kim_0-1714101342968.png

 

 

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" )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1714101368131.png

 

 

Jihwan_Kim_0-1714101342968.png

 

 

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" )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.