Forum Discussion

jananagarajan's avatar
jananagarajan
Regular Visitor
3 years ago
Solved

How to write Index calculation in DAX Power BI

I have written the Formula in Excel and would like to write the same in DAX    =INDEX(($C$2:$C$82),COUNTA($C$2:$C$82))   Sample File is attached   Kindly provide me your support   Customer...
  • v-yanjiang-msft's avatar
    3 years ago

    Hi jananagarajan ,

    According to your description, here's my solution.

    1.Add an index column in Power Query.

    2.If you only want the result show in the first row, create a calculated column.

    Column =
    IF (
        [Index] = 0,
        MAXX (
            FILTER ( 'Table', 'Table'[Index] = MAXX ( 'Table', 'Table'[Index] ) ),
            'Table'[Value]
        )
    )
    

    Get the result.

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.