Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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...
  • v-yulgu-msft's avatar
    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