Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
In this i need the sustainability time in minutes for each damper position. i.e., if my damper position 60 is from 07:09 and it changes to 0 at 07:18 then my sustainability time should be 8 minutes. How can i acheive this? Please share ASAP.
Solved! Go to Solution.
Create a new calculated column to calculate the time difference between each row.
DAX
TimeDifference =
VAR CurrentTime = 'Table'[Time]
VAR PreviousTime =
CALCULATE(
MAX('Table'[Time]),
FILTER(
'Table',
'Table'[Time] < CurrentTime
)
)
RETURN
IF(
ISBLANK(PreviousTime),
0,
DATEDIFF(PreviousTime, CurrentTime, MINUTE)
)
Proud to be a Super User! |
|
Sort the table by Time in ascending order.
Add an Index Column (called Index).
Add a custom column to track when a new segment starts:
Go to Add Column > Custom Column, name it Segment Key,
if [Index] = 0 then 0
else if [Damper Position] = #"Previous Step"[Damper Position]{[Index]-1} then null
else [Index]
Fill down the Segment Key column to assign segment start points across rows with the same damper position.
Group by Segment Key
Add columns
Min Time = Minimum of Time
Max Time = Maximum of Time
Damper Position = All Rows → Extract the first value from Damper Position
Add a custom column to calculate duration in minutes:
powerquery
Duration.Minutes([Max Time] - [Min Time])
Remove unnecessary columns and rename as needed.
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Sort the table by Time in ascending order.
Add an Index Column (called Index).
Add a custom column to track when a new segment starts:
Go to Add Column > Custom Column, name it Segment Key,
if [Index] = 0 then 0
else if [Damper Position] = #"Previous Step"[Damper Position]{[Index]-1} then null
else [Index]
Fill down the Segment Key column to assign segment start points across rows with the same damper position.
Group by Segment Key
Add columns
Min Time = Minimum of Time
Max Time = Maximum of Time
Damper Position = All Rows → Extract the first value from Damper Position
Add a custom column to calculate duration in minutes:
powerquery
Duration.Minutes([Max Time] - [Min Time])
Remove unnecessary columns and rename as needed.
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Create a new calculated column to calculate the time difference between each row.
DAX
TimeDifference =
VAR CurrentTime = 'Table'[Time]
VAR PreviousTime =
CALCULATE(
MAX('Table'[Time]),
FILTER(
'Table',
'Table'[Time] < CurrentTime
)
)
RETURN
IF(
ISBLANK(PreviousTime),
0,
DATEDIFF(PreviousTime, CurrentTime, MINUTE)
)
Proud to be a Super User! |
|
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 117 | |
| 107 | |
| 42 | |
| 32 | |
| 26 |