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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Aleksandra_MLT
Advocate I
Advocate I

To flag latest value per category

Hey guys, I have this DAX column but want to transfer it to PQ. Can you help ?

 

Latest modified =
var latest_date = CALCULATE ( MAX ( Statistics[Modified DateTime] ), ALLEXCEPT ( Statistics, Statistics[ActionKey] ) ) // extracting latest Modified date per action
var latest_date_flag = IF ( Statistics[Modified DateTime] = latest_date, 1, 0 ) // flagging latest Modified date per action
return
latest_date_flag
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Use Group By on the ActionKey column, select the Advanced radio button and you can add a column for the max Modified DateTime and also include all rows. Expand the resulting Table column and you can add a conditional column comparing the Modified DateTime to the max date time column

View solution in original post

2 REPLIES 2
jennratten
Super User
Super User

Hello - the current DAX column removes all context filters in the table except the filters for Statistics[ActionKey].  If this is really a calculated column and not a measure, you would need to provide more information on the other filters in use for Statistics[ActionKey] that are to be retained in order to convert this to Power Query.  To me though, I think this may be better suited as a DAX measure.

johnt75
Super User
Super User

Use Group By on the ActionKey column, select the Advanced radio button and you can add a column for the max Modified DateTime and also include all rows. Expand the resulting Table column and you can add a conditional column comparing the Modified DateTime to the max date time column

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors