Forum Discussion

JayPee's avatar
JayPee
Regular Visitor
4 years ago
Solved

Dax function for calculation using Previous value

Hi,   I am trying to achive the "Expected result" column in below table in one my Power Bi table, Kindly suggest is it possible to achive(Since I am new to Power Bi not sure about the correct funct...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a measure.

     

     

    Expected result measure: = 
    VAR _countmeasure = [Count measure:]
    VAR _result =
        SUMX (
            FILTER ( ALL ( Data ), Data[Roll No] <= MAX ( Data[Roll No] ) ),
            Data[Basket A] + Data[Basket B] - Data[Basket C]
        )
    RETURN
        IF ( HASONEVALUE ( Data[Roll No] ), _countmeasure + _result )