cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pabeader
Helper V
Helper V

Help calculating change between hours and/or minutes

I need to calculate the change in a value between hours, minutes and between entries.  Similar to how you can do between days or months.

 

I have no idea how to start or even if it's possible.  

 

Data is inventory level taken at 5 minute intervals.  

 

I suspect that Power BI can't do this.  Nothing in DAX for minutes or hours.  Not sure about M.  Might be something in there.

 

Data:

 

MaterialInventoryTimeStamp
18134/6/22 3:44:07 PM
18154/6/22 3:45:56 PM
18124/6/22 3:50:00 PM
18104/6/22 3:55:01 PM
18134/6/22 4:10:00 PM
2154/6/22 3:44:07 PM
2194/6/22 3:45:56 PM
2184/6/22 3:50:00 PM
2144/6/22 3:55:01 PM
2154/6/22 4:10:00 PM
2654/6/22 3:44:07 PM
2634/6/22 3:45:56 PM
2694/6/22 3:50:00 PM
2684/6/22 3:55:01 PM
262

4/6/22 4:10:00 PM

 

Output:

 

MaterialPer EntryPer Hour
18null 
182 
18-3 
18-2-3
1833
21null 
214 
21-1 
21-4-1
2111
26null 
26-2 
266 
26-13
26-6-6

 

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @pabeader ,

You can refer the following links to get it by DAX or Power Query Editor...

Calculating day/time difference

Handle in Power Query EditorHandle in Power Query Editor

Get the changes by DAXGet the changes by DAX

Power bi Date Difference – 8 Different Examples

Dynamically Compute Different Time Duration in Power BI Using DAX

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
yingyinr
Community Support
Community Support

Hi @pabeader ,

You can refer the following links to get it by DAX or Power Query Editor...

Calculating day/time difference

Handle in Power Query EditorHandle in Power Query Editor

Get the changes by DAXGet the changes by DAX

Power bi Date Difference – 8 Different Examples

Dynamically Compute Different Time Duration in Power BI Using DAX

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Love this work!  Unfortunatly, I did NOT do a good enough job in my explinaiton...  I'll try adding sample data and expected output.

VahidDM
Super User
Super User

Hi @pabeader 

 

Can you post sample data as text and expected output?
Not enough information to go on;

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

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

If data is needed then I'm not doing a good enough job explaing the need or the reader isn't going to be able to answer the request.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors