Forum Discussion
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 ID | Temp | Value | Calculated Value |
| T02 | 28 | 56 | 56 |
| T03 | 33 | 50 | |
| T06 | 29 | 56 | |
| T01 | 34 | 52 | |
| T04 | 33 | 56 | |
| T05 | 34 | 53 | |
| T01 | 26 | 56 | |
| T02 | 28 | 64 | |
| T03 | 28 | 58 | |
| T01 | 31 | 56 | |
| T05 | 32 | 52 | |
| T01 | 30 | 61 | |
| T02 | 31 | 53 | |
| T06 | 31 | 62 | |
| T04 | 28 | 62 | |
| T05 | 27 | 58 | |
| T02 | 33 | 50 | |
| T01 | 35 | 63 | |
| T03 | 33 | 57 | |
| T02 | 33 | 56 |
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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yanjiang-msft
Community Support
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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.