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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ApoorvaReddy
Frequent Visitor

URGENT - Calculate count of records filtering out previous state records

Hi,

 

I have a scenario below where a course (object.name) has 2 records in the table. First record which was accessed (In-progress) by an user (actor.mbox) and later has completed it. I am trying to get a count of all courses that were still In-progress but never got completed by an user. Can someone assist me in getting the right expression to pass ?

 

ApoorvaReddy_0-1593530531833.jpeg

 

“Inprogress Courses” = CALCULATE(DISTINCTCOUNT('Brand Excellence Academy_all'[object.name]),'Brand Excellence Academy_all'[verb.display]="accessed",'Brand Excellence Academy_all'[object.type]="course")

Requirement: Should also filter out courses if they are completed

 

“Completed Courses” = CALCULATE(DISTINCTCOUNT('Brand Excellence Academy_all'[object.name]),'Brand Excellence Academy_all'[verb.display]="completed",'Brand Excellence Academy_all'[object.type]="course")

 

Above expresssion works well for completed but “Inprogress Courses” should not take into count for those courses which are completed by an user.

 

Any help is really appreciated.

 

Thanks

1 ACCEPTED SOLUTION
Pulkit
Resolver I
Resolver I

You can subtract the two. For eg: Inprogress - Completed so if any course gets completed then it will get subtracted from in progress. 

View solution in original post

3 REPLIES 3
Pulkit
Resolver I
Resolver I

You can subtract the two. For eg: Inprogress - Completed so if any course gets completed then it will get subtracted from in progress. 

I am sorry, but i am new to DAX, can you use my expression above for "In-Progress" to modify and send it here.

 

Really appreciate your assistance !

I think i got it to work, used below expression and it worked.

 

CALCULATE(DISTINCTCOUNT('Brand Excellence Academy_all'[object.name]),'Brand Excellence Academy_all'[verb.display]="accessed",'Brand Excellence Academy_all'[object.type]="course") - CALCULATE(DISTINCTCOUNT('Brand Excellence Academy_all'[object.name]),'Brand Excellence Academy_all'[verb.display]="completed",'Brand Excellence Academy_all'[object.type]="course")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors