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 Aging Calculation

Hello everyone,

 

I am trying to calculate aging of status dynamically based on current date and first date of occurence.

In the below example, the first 3 cols are available in the source data and I need help in calculating "Latest_Status" and "Status_Aging".

 

Latest_Status: By Serial_Number, Status based on max(Updated_Date). For 100, Latest_Status=Critical since max(Updated_Date)=3/2/2023 and the Status is Critical.

Status_Aging: I need to calculate aging of each categories in Status column by Serial_Number based on when it occured first. For Serial_Number 100, Critical first appeared on 2/28/2023 hence aging =0 for that day, 1 on 3/1/2023 and 2 on 3/2/2023.

Both these calculations must be dynamic based on dates and status.

Serial_NumberUpdated_DateStatusLatest_StatusStatus_Aging
1003/2/2023CriticalCritical2
1003/1/2023CriticalCritical1
1002/28/2023CriticalCritical0
1002/27/2023HighCritical0
1002/26/2023ModerateCritical0
1002/25/2023LowCritical1
1002/24/2023LowCritical0
2002/20/2023ModerateModerate0
3002/10/2023HighHigh3
3002/9/2023HighHigh2
3002/8/2023HighHigh1
3002/7/2023HighHigh0
3002/6/2023LowHigh4
3002/5/2023LowHigh3
3002/4/2023LowHigh2
3002/3/2023LowHigh1
3002/2/2023LowHigh0
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26Rhg7-ZkuSfG9VrW3a?e=CMtTvs
Screen Capture #399.pngScreen Capture #400.png

View solution in original post

2 REPLIES 2
prasadhebbar315
Advocate I
Advocate I

@Ahmedx Thanks for the solution. This solution works now but if the updated date is not present for 02.03.2023 and it is available on 03.03.2023, your calculation is skipping the day and assinging values based on rankx. In the below example: ML_Updated_Date is missing for 02.03.2023. Ideally status aging should be 2 for 02.03.2034 and 3 for 03.03.2023.

prasadhebbar315_0-1677820970198.png

 

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26Rhg7-ZkuSfG9VrW3a?e=CMtTvs
Screen Capture #399.pngScreen Capture #400.png

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.