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
Anonymous
Not applicable

Comparing data (dates) from the same table with same ID, and displaying the max date

Hi,

 

I was wondering if it's possible to compare dates within the same table with same ID, but the catch is that there is an additional column that display the status. For instance, here's a table:

 

IDStatusDate
1Running2/3/2018
1Stopped4/4/2018
2Running3/24/2018
2Stopped1/2/2018

 

----------------------------------------------------

 

The results I'm expecting to see is this:

 

IDStatusDate (highest date)
1Stopped4/4/2018
2Running3/24/2018

 

 

Is there a way I can do this? A group by with ID would work, but the status column part would not being showing. Maybe using M language or DAX or something from the GUI. Could you show me a solution? I recently started using PowerBI at work, so I still have a lot to learn.

 

Thanks

 

 

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi bcwan,

 

You can create a measure using DAX formula like below:

Date(highest date) = CALCULATE(MAX(Table1[Date]), ALLEXCEPT(Table1, Table1[ID]))

Capture.PNG 

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi bcwan,

 

You can create a measure using DAX formula like below:

Date(highest date) = CALCULATE(MAX(Table1[Date]), ALLEXCEPT(Table1, Table1[ID]))

Capture.PNG 

 

Regards,

Jimmy Tao

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.