Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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! |
|
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |