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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Show last updated category for each ID

Hello,

 

I have 3 columns (ID, Status and Last_Updated_Date). ID can repeat and the status can change from Low->Moderate->High->Critical. I would like to capture Max_Date for each ID based on max(Last_Updated_Date) and Latest_Status is Status from max(Last_Updated_Date). Here is an example from excel file. Can someone help achive this in PBI please?

 

IDStatusLast_Updated_DateMax_DateLatest_Status
100High2/14/20232/14/2023High
100High2/13/20232/14/2023High
100Low2/12/20232/14/2023High
200Critical2/12/20232/12/2023Critical
300Moderate2/13/20232/13/2023Moderate
300Low2/12/20232/13/2023Moderate

 

2 ACCEPTED SOLUTIONS
Ahmedx
Super User
Super User

Max_Date = 
CALCULATE (
    MAX ( 'Table'[Last_Updated_Date] ),
    ALLEXCEPT ( 'Table', 'Table'[ID] )
)
-----
Latest_Status = 
CALCULATE (
    MAX ( [Status] ),
    ALL ( 'Table' ),
    'Table'[ID] = EARLIER ( 'Table'[ID] )
        && 'Table'[Last_Updated_Date] = 'Table'[Max_Date]
)

https://dropmefiles.com/RrfxE

View solution in original post

miTutorials
Super User
Super User

4 REPLIES 4
miTutorials
Super User
Super User

I have explained in this tutorial please do check this out.

 

Get another column value based on the Max Date or Max Value in PowerBI 

Thanks @miTutorials 

Ahmedx
Super User
Super User

Max_Date = 
CALCULATE (
    MAX ( 'Table'[Last_Updated_Date] ),
    ALLEXCEPT ( 'Table', 'Table'[ID] )
)
-----
Latest_Status = 
CALCULATE (
    MAX ( [Status] ),
    ALL ( 'Table' ),
    'Table'[ID] = EARLIER ( 'Table'[ID] )
        && 'Table'[Last_Updated_Date] = 'Table'[Max_Date]
)

https://dropmefiles.com/RrfxE

@Ahmedx Fantastic. Your solution works 🙂

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors