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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
SrMatto
Helper I
Helper I

Count most recent value with a rule

Hi,
I'm trying to achieve the following table representation:
For each Activity, count the number of IDs that are doing it in their most recent DateID.
Important: there are duplicates, so keep only the alphabetical MAX.

Expected: 

SrMatto_3-1730478683703.png
FactActivity table:

SrMatto_0-1730479775809.png

My data model is:

SrMatto_1-1730479788955.png

 

My current calculation is wrong because it is affected by the row context. (the total count should be 4)

SrMatto_2-1730479911659.png

Count Most Recent Activity =

VAR LatestDate= CALCULATE( MAX(FactActivity[DateID]), ALLEXCEPT(FactActivity, FactActivity[ID]) )

RETURN

COUNTX(FactActivity, CALCULATE(MAX(FactActivity[Activity]), FactActivity[DateID]=LatestDate))  

 

link to pbix 

 

 

 

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1730492159585.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

1 REPLY 1
ThxAlot
Super User
Super User

ThxAlot_0-1730492159585.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
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.