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

Trying to measure elapsed time with a record that appears on more than one row of a table

I've got data from our SQL server, coming from a Dynamics AX installation. We have warehouse picking journals that often consist of multiple lines.  The way my table is presented, is that some information from the record header is joined on as a reference on the line data. Here's an example of a two line picking journal.

2019-08-26_9-37-00.jpg

I'm working with some creation and modified times, and I've created a simple measure to give an elapsed time, to show how long it was until the work was completed:
 

Elapsed Picking TIme =
SUMX(PickingData, PickingData[MODIFIEDDATETIME] - PickingData[CREATEDDATETIME])
 

I want to buld a visual that shows the elapsed time, per record header. So something like this, but you can see that when I take out the line info, it builds a sum of the time result for both lines.

2019-08-26_9-52-17.jpg

How best could I acheive this? Change my measure, or change my approach on the visual?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Perhaps try changing SUMX to AVERAGEX


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Perhaps try changing SUMX to AVERAGEX


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks, I imagine that is a perfectly good solution, but in my case I'm working with test data at the moment, which isn't finalized, and will probably get my developer to build me a calculated column, rather than worry about this in the BI report.

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.