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
MKPBI_2805
Frequent Visitor

Help Needed on RANKX Function

 I am using below Formula to get Ranks of Sales Reps.

 

RANKX(ALLSELECTED('Sheet2'),CALCULATE(DIVIDE(sum('Sheet2'[S_Rev]),sum('Sheet2'[B_Rev]),BLANK())),,DESC,Dense)
 
My DataSet has Columns - Rep_Name , Role_Type , Product_Type, Quarter , Quarter_To_Day , B_Rev, S_Rev Fields.
 
Measure : CR%= DIVIDE(sum('Sheet2'[S_Rev]),sum('Sheet2'[B_Rev]),BLANK())
 
Slicers on Top
Role_Type     ,   Product_Type
 
Rep_NameB_Rev S_RevCR% Rank_CR%
Rep_11000001000010% 
Rep_2200000100005% 
Role_Type , Product_Type are added in the Table , Rankx() is working fine. But when removed from Table and added as Slicers Rankx() is giving wrong results.
 
1 ACCEPTED SOLUTION

Hi @MKPBI_2805 ,

 

 

RANKX(ALLSELECTED(Sheet2[Rep Name],Sheet2[AI Score]),[CR%_CQTD],,DESC,Dense)

 

 

4.JPG

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

8 REPLIES 8
harshnathani
Community Champion
Community Champion

Hi @MKPBI_2805 ,

 

 

Use the following measure:

 

 

Rank_CR% = RANKX(ALLSELECTED('Sheet2'),DIVIDE(CALCULATE(sum('Sheet2'[DT Services Revenue])),CALCULATE(sum('Sheet2'[Base_Rev]))),,DESC,Dense)
 
and 
 
Dont' Summarize in DT Services Revenue.
 
2.JPG1.jpg
 
 
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Have updated the PBI file with actual columns needed in reporting.

 

https://drive.google.com/file/d/1AcRE06ckGJbc-T-VxXUQHBU_ctC9Lmip/view?usp=sharing

 

Could you pls help.

Hi,

 

Please try this measure:

Rank_CR% =
VAR a =
    SUMMARIZE (
        ALLSELECTED ( Sheet2 ),
        Sheet2[Rep Name],
        Sheet2[AI Score],
        "CR%_CQTD", [CR%_CQTD]
    )
RETURN
    RANKX ( a, CALCULATE ( [CR%_CQTD] ),, DESC, DENSE )

The result shows:

1.PNG

See my attached pbix file.

 

Best Regards,

Giotto

Hi @MKPBI_2805 ,

 

 

RANKX(ALLSELECTED(Sheet2[Rep Name],Sheet2[AI Score]),[CR%_CQTD],,DESC,Dense)

 

 

4.JPG

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Power BI FIle is available here.

 

https://drive.google.com/file/d/1AcRE06ckGJbc-T-VxXUQHBU_ctC9Lmip/view?usp=sharing

 

RANKX Function help needed.

Hi @MKPBI_2805 ,

 

Cannot access the file.

 

Have sent a request . Pls share file.

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

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.