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
pbimhkc
Frequent Visitor

Calculate time between different rows based on user_id and status column values

I have a table that tracks status updates for different people. Some of the metrics I am trying to get is the duration between different statuses at the person level, and also at an aggreagate level. There are many different statuses but only a few I want to know the times between and often the statuses being compared are not in sequential rows. For example a few would be time between 'Sent' and 'Approved', 'Sent' and 'Denied', and 'Appealed' and 'Approved'. Is this something I can do with DAX given the current data structure?

 

person_idstatusstatus update
1Sent5/1/22 12:00
1Approved5/2/22 8:00
2In Progress5/2/22 14:15
3In Progress5/1/22 8:45
3Sent5/2/22 9:00
3Denied5/3/22 13:00
3Appealed5/4/22 8:30
3Approved5/5/22 15:00
4Sent 5/4/22 10:00
4Administrative Denial5/5/22 9:30

 

For person 1 I would want to see sent to approved was 20 hours

For person 3 - sent to denied was 28 hours, appealed to approved was 30.5 hours, and sent to approved was 78 hours

For person 4 - sent to administrative denial (denial) was 23.5 hours

 

And then I would want averages of those - average (mean) sent to approved (20 hours and 78 hours) was 49 hours, sent to denied (28 and 23.5) was 25.75 hours, etc.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome of the visualization looks like, but please check the below picture and the attached pbix file.

The average of each metric is described in the Total row of the table visualization.

All measures are decribed in the attached pbix file.

 

Untitled.png


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome of the visualization looks like, but please check the below picture and the attached pbix file.

The average of each metric is described in the Total row of the table visualization.

All measures are decribed in the attached pbix file.

 

Untitled.png


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.