Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jananagarajan
Regular Visitor

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 
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @jananagarajan ,

According to your description, here's my solution.

1.Add an index column in Power Query.

vkalyjmsft_0-1664416799804.png

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.

vkalyjmsft_1-1664416940531.png

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.

 

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @jananagarajan ,

According to your description, here's my solution.

1.Add an index column in Power Query.

vkalyjmsft_0-1664416799804.png

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.

vkalyjmsft_1-1664416940531.png

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.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.