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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sirros_iot
Helper III
Helper III

Difference about time between consecutive time rows to use it as a variable

Hello all!

First time here, sorry anything.

 

I need to discover the difference in seconds about two consecutive rows and then combine it with an average of time in an especific id. OBS: I can't use the PQ, so, no calculated columns. My data comes from a device( arduino).

 

This is my idea.

 

.Tempo concl = "Hole time in one execution request from a machine". 

.TimeAll = AVERAGE from the time.

 

VAR X = IF (( [.Tempo concl.] )) > (2 * 'RealTimeData'[.TimeAll]);
"Suspended";"Working")

RETURN
VAR X

 

Any help, Thanks.

All my data

In the right I have timestamp

2017-12-01 17.26.21.png

 

3 REPLIES 3
MattAllington
Community Champion
Community Champion

2 things

 

i suggest you split date and time in different columns. This will make the workbook a lot smaller. You should do this match in the query editori stead of dax. Watch my video here https://m.youtube.com/watch?v=xN2IRXQ2CvI



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thank you for the answer. I will see what I can do, I can't use power query because I'm getting the data from the power BI online.
Anonymous
Not applicable

HI @sirros_iot,

 

I'd like to suggest your to convert these time part to numeric(total second), then you can direct calculated on them. After calculation, you can transfer result to time format.

 

Reference link:
Aggregating Duration/Time

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.