Forum Discussion

jananagarajan's avatar
jananagarajan
Regular Visitor
4 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 IDTempValueCalculated Value
T02285656
T033350 
T062956 
T013452 
T043356 
T053453 
T012656 
T022864 
T032858 
T013156 
T053252 
T013061 
T023153 
T063162 
T042862 
T052758 
T023350 
T013563 
T033357 
T023356 
  • 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.

     

1 Reply

  • 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.