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
Anonymous
Not applicable

Rank Percentage in Power BI

Hi,

 

I have a question regarding the ranking of Percentage. I have the following table:

GoodsManagerPercentage
BedManager 194.87%
TableManager 294.79%
TableManager 382%
ChairManager 179%

 

I need another column showing the rankings. In the sense, it should look like the following:

GoodsManagerPercentageRanking
BedManager 194.87%1
TableManager 294.79%2
TableManager 382%3
    

I tried my best,  but nothing was just happening. It shows all rankings as "1". I calculated the percentages with the help of a measure. The measure is: Percentage = 'Main Data'[Net Sales]/[Gross Sales]. 

6 REPLIES 6
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

Please try like this:

Ranking = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Goods],'Table'[Manager]),[Percentage],,ASC,Dense)

If this doesn't work, please consider releasing a pbix file without private data, that would be helpful, thanks.
How to provide sample data in the Power BI Forum

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

tackytechtom
Super User
Super User

Hi @Anonymous ,

 

How about this:

tackytechtom_0-1696878117939.png

 

 

Here the DAX for the ranking measure. 

RankingMeasure = 
RANKX(
    ALLSELECTED ( 'Main Data' ),
    [PercentageMeasure], 
    , DESC
    , DENSE 
)

 

I took the snippet from here.

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Hi, No it still didnt work. Dont know how did you get this. but I am not able to get it. 

Hi @Anonymous ,

 

Is this one a measure or a calculated column?

tackytechtom_0-1696878743652.png

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

it is a measure

Anonymous
Not applicable

Hi, I dont know how the digits have got shifted. Its Actually |Manager 1|  |94.87%|

                                                                                                |Manager 2||  |94.79%|

 

and so on....

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.