Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
FlowViz
Helper III
Helper III

Help calculating timestamp differences

Hi folks,

 

I have a table like so:

 

Screenshot 2022-02-01 at 22.00.57.png

 

I'm trying to calculate a couple of things:

1) How would I calculate the total time in each ColumnName for each WorkItemId?
For example for WorkItemID 696 I'd expect to see:
New - 7

To Do - 0

In Progress - 63

In Build/In Dev - 5

 

Note: once it gets to 'Done' I don't care how long it spends there

 

2) Some of the ColumnName types are 'Waiting' columns and some are 'Doing' columns and I'd like to calculate the percentage of time 'Doing' compared to the total time (i.e. 'Waiting' + 'Doing') - how could I do this and is there a way it could be done so the user could 'toggle' what these 'Waiting' or 'Doing' ColumnNames are (with the percentage updating to reflect this).

 

Have added the .pbix here to help anyone who can assist 🙂

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

How did you arrive at the answers of 7,0,63 and 5?


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

For example, the 63 calculation is for when the item went into ColumnName of 'In Progress' on 10/17/2021 and then went into ColumnName of 'In Build' on 12/19/2021, meaning it was in 'In Progress' for 63 days...

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

Thank you! 

You are welcome.


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

Hi @FlowViz 

 

You should be able to use the following:

 

Sum by Category = CALCULATE ( SUM ( 'Table'[Revision] ) , FILTER ( ALLSELECTED ( 'Table' ) , [ColumnName] = MAX ( 'Table'[ColumnName] ) ) )

Please adjust the Table name to your table name.

 

All the best.


Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Sorry this did not work:

Screenshot 2022-02-02 at 17.32.47.png

TheoC
Community Champion
Community Champion

Apologies on that @FlowViz . Thank you for letting me know. Have since modified but I am glad that @Ashish_Mathur could provide a great solution!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.