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
huafuuw_cho
New Member

Power BI (DAX) How to Ranking by percentage

I  have a data set "Test1" with repeat customer with all customer by month. then I count and calculate to percentage

CustomerIDAREARepeat
001A 
001ARR
002A 
003A 
004B 
005C 
001ARR
006B 
005CRR
007A 
008B 
009C 
010C 

 

 

Count_all_customer = COUNTROWS(Test1)

Count_Repeat_customer = COUNTROWS(FILTER(RELATEDTABLE(Test1),Test1[Repeat]="RR"))

 

%repeat_customer = ([Count_Repeat_customer]/[Count_all_customer])

 

Now, I want to Ranking Percent Repeat Customer by Area like this

AREAall Customerrepeat Customer%RRRanking
A6233%3
B300%1
C4125%2

 

when I used RANKX --> Result all ranking is "1"

Please advise how to correct this formula to achieve the desired result

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi, 

I am not sure I follow but as I understood you want to RANK your values based on %repeat_customer

Here is how to do this:

Ranking M = RANKX(ALL('Table (2)'),[%repeat_customer],,ASC)

End result:
ValtteriN_0-1694498149236.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Super User
Super User

Hi, 

I am not sure I follow but as I understood you want to RANK your values based on %repeat_customer

Here is how to do this:

Ranking M = RANKX(ALL('Table (2)'),[%repeat_customer],,ASC)

End result:
ValtteriN_0-1694498149236.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




thanks you , that's work   😃

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.