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
prasadhebbar315
Advocate I
Advocate I

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