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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
elmarcinpbi
Frequent Visitor

Calculate Measure Filter - Only Include Latest Record in RowCount

 

I have a report visual that needs the percentage of people referred to program that actually enrolled in the program.  People can be referred more than once. 

 

I have this measure but I would only like to restrict it to the latest Disposition date. 

 

ReferredToH = CALCULATE(COUNTROWS(ProgramDisposition),FILTER(ProgramDisposition,(ProgramDisposition[tkh_DispositionDate]<=LASTDATE('Calendar'[Date])&&[tkh_DispositionDate]>=FIRSTDATE('Calendar'[Date])&&(ProgramDisposition[DispositionTypeValue]=969750000))))

 

Is there a way to include only the latest occurence of a program disposition in this measure?

 

Thank you

 

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @elmarcinpbi,

 

You can create a measure like below:

 

Measure= var latest=Calculate(MAX(ProgramDisposition[tkh_DispositionDate]),all(ProgramDisposition))

return

CALCULATE(COUNTROWS(ProgramDisposition), Filter(all(ProgramDisposition), ProgramDisposition[tkh_DispositionDate] =latest))

 

If the above DAX doesn't work, please share some dummy data and expected results for our analysis.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for the response.  I used a table group and a join to get what I needed, but when I have a minute I will test out this syntax.  I appreciate the help.

 

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.