Forum Discussion

quyen103's avatar
quyen103
Frequent Visitor
9 years ago
Solved

DAX calculation

Hello friends, I hope someone can help me out with this problem.  I don't know how I can implement this calculated column in PowerBI. Should I use DAX? calculated function? data modelling? should I...
  • Sean's avatar
    9 years ago

    quyen103

    Add an Index Column in the Query Editor as shown in the image below...

    Then create this COLUMN

     

    Column 3 =
    VAR CurIndex = 'Table'[Index]
    RETURN
        IF (
            'Table'[Column0] = 1,
            BLANK (),
            CALCULATE (
                SUM ( 'Table'[Column1] ) + SUM ( 'Table'[Column2] ),
                FILTER ( 'Table', 'Table'[Index] = CurIndex + 1 )
            )
        )

     

     

    Hope this helps! :smileyhappy: