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
Gingerjeans88
Helper IV
Helper IV

Calculate time between stages across multiple rows with repeated unique ID

Hello,

I hope you’ll be able to help me.
I have a database of quotes, all with a unique ID, and every time the quote moves to a new stage a new row is added with the start and end date in that stage. The stage category is also named.

How do I count the time (in minutes) between each of the stages, per unique ID? Considering there are multiple entries for each ID?

I presume it needs a count and a max and min, then a diff in days, but I want the output in columns as it’s not the end visual, but needs to be used in an eventual visual.

Thanks!
1 ACCEPTED SOLUTION

Hi,

Write this calculated column formula

Duration = [Stage End Time]-[Stage Start Time]

To your visual, drag Quote and write this measure

=SUM(Data[Duration])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Nathaniel_C
Super User
Super User

Hi @Gingerjeans88 ,

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

If you could provide your pbix, or dummy values for both the present table, and expected results, that would be great.  Copy and paste the tables rather than a picture, so we can do the same into a pbix.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C , Response above!

 I'm so sorry - first time posting! Thanks for the guidance. 

QuoteStageStage Start Time  
QUO100011. Initial Stage01/01/2019 12:3001/01/2019 12:34 
QUO100221. Initial Stage10/02/2019 10:0511/02/2019 10:10 
QUO100012. Secondary Stage01/01/2019 12:3501/01/2019 12:40 
QUO100013. Tertiary Stage01/01/2019 12:4101/01/2019 12:50 
QUO100222. Secondary Stage10/02/2019 10:1111/02/2019 10:13 
QUO100221. Initial Stage10/02/2019 10:0511/02/2019 10:10 
QUO100222. Secondary Stage10/02/2019 10:1111/02/2019 10:13 
QUO100223. Tertiary Stage10/02/2019 10:1411/02/2019 10:20 

 

I have chosen to use dummy data, is that format ok? I want to know the time between each of those stages for each record, and then I want to sum them later.

Hi,

Write this calculated column formula

Duration = [Stage End Time]-[Stage Start Time]

To your visual, drag Quote and write this measure

=SUM(Data[Duration])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share a dataset and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.