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
Anonymous
Not applicable

filtering and calculating

Hello,

I have this table:

image.png

 

And My goal is to calculate time difference between differents statuses. OldValue and NewValue represent old and new statuses. It is important to sort ascending CretedDate column before any calculation. And the last important note is ParentId it is id of the company. Right now I have just filtered one company, but the trick is that data is messy as it is in the pic above.

 

So the question is how to calculate time difference between 2 stages for the same company?

 

filtered.PNG

4 REPLIES 4
Anonymous
Not applicable

hi @Anonymous 

what are the other fields in the table? is there only one time period? Do you also get the status change date for the new value? What's the source you're extracting data from?

Thanks

Anonymous
Not applicable

Hi @Anonymous 

 - This is all fields that I have.
 - Yes only one time period, so it works this way: 5/31/2019 5:47 C-complete status was choosed, and several actions was done maybe automaticly as a trigger, then 5/31/2019 8:21 manager choosed  d-compliance status, then 5/31/2019 10:52 from d-compliance manager choosed c-reporting/testing status and so on.
 - Source is Salesforce DBimage.png

Anonymous
Not applicable

@Anonymous  You need to split the date column into two parts, One to have the Date and the other column will be TIMEx

In the power query GROUP BY

In GROUP BY = Date

Add two new columns 

MinH     MIN    TIMEx

MaxH    MAX    TIMEx

once done select OK

 

Create a Custom Column ( this is your final measure) in Power Q --> add the below code.

=Duration.Hours([MaxH]-[MinH])

All good  🙂

Anonymous
Not applicable

Did my solution resolve your issue?
Thanks

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.