Forum Discussion
Anonymous
7 years agoNot applicable
Error in my code?
Hey! Can anyone see what gets wrong with my DAX formula? I write following: NewRunLoad = VAR minIndx = CALCULATE ( MAX ( Data[Index] ), ALLEXCE...
- 7 years ago
Hi Anonymous,
Please refer to below DAX formula:
NewRunLoad = IF ( CALCULATE ( MAX ( Data[Index] ), FILTER ( ALLEXCEPT ( Data, Data[Device] ), [Index] < EARLIER ( Data[Index] ) ) ) = BLANK (), BLANK (), Data[TimeLoaded_LC] - CALCULATE ( SUM ( Data[TimeLoaded_LC] ), FILTER ( ALLEXCEPT ( Data, Data[Device] ), [Index] = EARLIER ( Data[Index] ) - 1 ) ) )Best regards,
Yuliana Gu
v-yulgu-msft
7 years agoMicrosoft Employee
Hi Anonymous,
Please refer to below DAX formula:
NewRunLoad =
IF (
CALCULATE (
MAX ( Data[Index] ),
FILTER ( ALLEXCEPT ( Data, Data[Device] ), [Index] < EARLIER ( Data[Index] ) )
)
= BLANK (),
BLANK (),
Data[TimeLoaded_LC]
- CALCULATE (
SUM ( Data[TimeLoaded_LC] ),
FILTER (
ALLEXCEPT ( Data, Data[Device] ),
[Index]
= EARLIER ( Data[Index] ) - 1
)
)
)
Best regards,
Yuliana Gu