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

Work out difference in time between events

I have a table which looks like the below.

 

m_richardson_0-1679514703336.png

 

This details actions taken for finance applications, where there can be multiple action types per application.  The application ID identifies the application.  Each action is timestamped, has a type and a person who carried it out.  In the example above you can see two applications and the actions in sequence from Application Start to Paidout.

What I would like to figure out is how I can measure the difference in time between certain action types to use for reporting.  As an example, I would like to know how to know the average time taken from 'Application Start' to 'Paidout'.  I would filter this on a page by user or datetime perhaps.  

 

What DAX would help me to achieve this? 

2 REPLIES 2
amitchandak
Super User
Super User

@m_richardson , Try like

 

Measure =
var _min = calculate(min(Table[Date Time], allexcept(Table, table[Application ID]), filter(Table, Table[Application Type] = "Application Start"))
Var _max = calculate(max(Table[Date Time], allexcept(Table, table[Application ID]), filter(Table, Table[Application Type] = "Paidout"))
return
averagex(Values(Table[Application ID]), datediff(_min, _max, minute))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Apologies for the delay, but this doesn't work. The parentheses don't match up, and I'm getting an error that MIN only needs two arguments passing to it.

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.