Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hey!
I wanna calculate the RunTime of a device the last 24 hours, but I am having problem to make it filter just its devices as:
Device Index TotalRunTime (h) (NewRunLoad)
A 1 2046 6
B 2 3 3
A 3 2040 0
B 4 0 0
(There are even more data)
I want a column that calculates the different since the last index OF ITS OWN DEVICE. For example for device A 2046-2040 = 6, I tried a couple of different functions but I cant really figure it out.
NewRunLoad =
var ett = LOOKUPVALUE('Data'[RunLoad_h], Data[Index], Data[Index])
var tva = LOOKUPVALUE('Data'[RunLoad_h],'Data'[Index], Data[Index]-1)
return
CALCULATE(ett-tva, ALLEXCEPT(Data,Data[Device])
Kind regards
Solved! Go to Solution.
@Anonymous
I think this should do what you want:
Column = VAR minIndx = CALCULATE ( MIN ( Table1[Index] ), ALLEXCEPT ( Table1, Table1[Device] ), Table1[Index] > EARLIER ( Table1[Index] ) ) RETURN IF ( ISBLANK ( minIndx ), BLANK (), Table1[TotalRunTime (h)] - CALCULATE ( SUM ( Table1[TotalRunTime (h)] ), Table1[Index] = minIndx, ALL ( Table1 ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
@Anonymous
I think this should do what you want:
Column = VAR minIndx = CALCULATE ( MIN ( Table1[Index] ), ALLEXCEPT ( Table1, Table1[Device] ), Table1[Index] > EARLIER ( Table1[Index] ) ) RETURN IF ( ISBLANK ( minIndx ), BLANK (), Table1[TotalRunTime (h)] - CALCULATE ( SUM ( Table1[TotalRunTime (h)] ), Table1[Index] = minIndx, ALL ( Table1 ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |