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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
TexasStone
Frequent Visitor

DAX Measure, Slicer Selected Last Date on Graph

Hello everyone. I've been banging my head against the wall trying many iterations of this. I've provided an example of the data below. Basically I'm trying to plot how many people finish a group of courses (the last day they finish a course in the selected group) vs. the date on a plot. The Class slicer can change to a users selection and is a separate table.

I thought I would do something like this but am running into issues getting the proper value and plotting it on a visual. The user can select any combination of courses in the slicer. In the below example they have selected A, B, and C - which only four people have completed. Their final completoin date would then be plotted against how many users finished on that date.

 

calculate(distinctcount(Table[Name],filter(Table, Courses Completed = Courses Selected && Table[Completed] = max(Table[Completed])

 

Without bringing in the date to a visual I can count the correct number of users that have completed all of the courses.

CoursesSelected = calculate(countrows(CourseListTable))

Current Courses Completed = calculate(distinctcount(Table[Class]))

Current People Completed = calculate(countrows(filter(values(Table[Name]),Current Courses Completed = Courses Selected)))

I appreciate any advice or links to tutorials!

Pic.png

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@TexasStone I did it like the following. PBIX is attached below signature.

Measure = 
    VAR __Date = MAX('Dates'[Date])
    VAR __NumCourses = COUNTROWS('CourseListTable')
    VAR __Table = SUMMARIZE('Table',[Name],"__Count",COUNTROWS('Table'),"__Latest",MAX('Table'[Completed]))
    VAR __Return = COUNTROWS(FILTER(__Table,[__Count]=__NumCourses && [__Latest] = __Date))
RETURN
    __Return


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@TexasStone I did it like the following. PBIX is attached below signature.

Measure = 
    VAR __Date = MAX('Dates'[Date])
    VAR __NumCourses = COUNTROWS('CourseListTable')
    VAR __Table = SUMMARIZE('Table',[Name],"__Count",COUNTROWS('Table'),"__Latest",MAX('Table'[Completed]))
    VAR __Return = COUNTROWS(FILTER(__Table,[__Count]=__NumCourses && [__Latest] = __Date))
RETURN
    __Return


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

This is awesome, thank you so much @Greg_Deckler 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.