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

Dynamic Status Aging

Hello everyone,

I am working on a solution to identify Status Aging of cases dynamically. In the below table there are 2 serial numbers. I have the Latest_ML_EPV_Status and ML_Updated_date. I would like to calculate Status_Aging based on the Latest_ML_EPV_Status and when the category occured first.

For Serial Number=HDUMMYFR, Status has been changing but the latest is Moderate and it occured on 03/13/2023. Therefore Status_Aging is 2 days. 

For Serial Number=ABCMMYFR, Status has been changing but the latest is Critical and it occured on 03/11/2023. Therefore Status_Aging is 4 days. 

machine_serial_numberML_EPV_STATUSLatest_ML_EPV_StatusML_Updated_dateStatus_Aging
HDUMMYFRModerateModerate3/15/20232
HDUMMYFRModerateModerate3/14/20232
HDUMMYFRModerateModerate3/13/20232
HDUMMYFRHighModerate3/11/20232
HDUMMYFRModerateModerate3/11/20232
HDUMMYFRModerateModerate3/9/20232
HDUMMYFRModerateModerate3/8/20232
HDUMMYFRHighModerate3/7/20232
HDUMMYFRHighModerate3/6/20232
HDUMMYFRHighModerate3/5/20232
ABCMMYFRCriticalCritical3/15/20234
ABCMMYFRCriticalCritical3/14/20234
ABCMMYFRCriticalCritical3/13/20234
ABCMMYFRCriticalCritical3/11/20234
ABCMMYFRCriticalCritical3/11/20234
ABCMMYFRModerateCritical3/9/20234
ABCMMYFRCriticalCritical3/8/20234
ABCMMYFRHighCritical3/7/20234
ABCMMYFRHighCritical3/6/20234
ABCMMYFRHighCritical3/5/20234
3 ACCEPTED SOLUTIONS
Ahmedx
Super User
Super User

1) you can do it as a calculated column

1.png

 

2)You can also do this with measure.

 

2.png
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhkEEF86jKOotUxxR?e=eDMGD4

View solution in original post

CNENFRNL
Community Champion
Community Champion

Don't bother to keep [Latest_ML_EPV_Status] in the dataset for this calculation.

CNENFRNL_0-1678960113834.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

@CNENFRNL Your solution has worked Thanks

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

Don't bother to keep [Latest_ML_EPV_Status] in the dataset for this calculation.

CNENFRNL_0-1678960113834.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL Your solution has worked Thanks

Ahmedx
Super User
Super User

1) you can do it as a calculated column

1.png

 

2)You can also do this with measure.

 

2.png
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhkEEF86jKOotUxxR?e=eDMGD4

@Ahmedx Thanks the 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.