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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

calculate RANK

hello Guys
i want to calculate the rank in power bi 
below is my Datset

count FWCSAT
121
11
212
172
143
193
123

 I want to calculate CSAT RANK and CSAT RANK Final 
expected Result is 

FWCSATCSAT RANKCSAT RANK FINAL
12111.01
1111.02
21222.01
17222.02
143233.01
193233.02
123233.03

 Plz Help how to Calculate CSAT RANK and CSAT RANK Clean

Thanks
pardnya 137

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You need to add a column of index to the Power Query.

vzhangti_0-1669101777014.png

Column:

CSAT Rank = RANKX('Table',[CSAT],,ASC, dense)
Column = 
CALCULATE (
    COUNT ( 'Table'[CSAT] ),
    FILTER (
        'Table',
        [CSAT] = EARLIER ( 'Table'[CSAT] )
            && [Index] <= EARLIER ( 'Table'[Index] )
    )
)
CSAT RANK FINAL = [CSAT Rank]+[Column]*0.01

vzhangti_1-1669102010606.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
FreemanZ
Super User
Super User

Seems like ranking of multi-layers. Please check this:

FreemanZ_0-1669106540280.png

 

the codes for the two added columns:

CSAT RANK =
RANKX(
    ALL(TableName),
    TableName[CSAT],
    ,
    ASC,
    Dense
)
 
CSAT RANK Clean =
VAR  CSATRANKClean2 =
    VAR CurrentCSAT = TableName[CSAT]
    VAR Table1 =
    FILTER(
        TableName,
        TableName[CSAT] = CurrentCSAT
    )
    RETURN
        RANKX(
        Table1,
        TableName[FW],
        ,
        ASC
    )
RETURN
    TableName[CSAT RANK]&"."&FORMAT(CSATRANKClean2,"00")
 
same topic?
amitchandak
Super User
Super User

@Anonymous , Based on what I got

 

Create a new rank column

 

CSAT Rank  = Rankx(Table, [CSAT],,asc, dense)

 

and a new column

CSAT final  Rank = [CSAT Rank]+ [CSAT Rank]/100

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks of reply @amitchandak 
CSAT RANK is correct we can use RANKX function but 
CSAT RANK Final is not i want to calculate the rank final like when the rank is Repeated it should be increment by 0.01..I want below result of CSAT Rank Clean.. Please Help..

CSAT RANKCSAT RANK Clean
11.01
11.02
11.03
11.04
11.05

Thanks
pradnya

Hi, @Anonymous 

 

You need to add a column of index to the Power Query.

vzhangti_0-1669101777014.png

Column:

CSAT Rank = RANKX('Table',[CSAT],,ASC, dense)
Column = 
CALCULATE (
    COUNT ( 'Table'[CSAT] ),
    FILTER (
        'Table',
        [CSAT] = EARLIER ( 'Table'[CSAT] )
            && [Index] <= EARLIER ( 'Table'[Index] )
    )
)
CSAT RANK FINAL = [CSAT Rank]+[Column]*0.01

vzhangti_1-1669102010606.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.