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

Top 20 Ranking

Hi,

 

Can someone please help me out with this one, I have searched the community and tried a number of the solutions tht have been provided but I have unfortunatley I haven't had any luck.

 

I want to create a rank measure that give me the top 20 ratios if that ratio is higher than 2.0. I was unable to create another measure based on the existing measure. Therefore I figured I need to add the calculation in the ration measure to my new rank measure and have had no luck..Here is basic ratio measure....

 

Ratio = SUM('Table'[Field])/SUM('Table'[Field])

 

I tried this out which I thought might give me what I want but didn't work out

 

SumPointsRank = 
Var summry=SUMMARIZE(ALLSELECTED(Results),[Player],"Sum",SUM(Results[Points]))
var tmp=ADDCOLUMNS(summry,"RNK",RANKX(summry,[Sum],,DESC,Dense))
return
MAXX(FILTER(tmp,[Player]=SELECTEDVALUE(Results[Player])),[RNK])

Source: Solved: Ranking a measure - Microsoft Power BI Community

 

Cheers,

 

Chris

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.  You will see the Top 3 Pincodes by ratio in descending order.  The Top 3 are obtained by a DAX measure.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur 

 

The data I am dealing with looks like

 

Money InMoney OutPostcode
14000190003001
13000110003002
22000130003003
17000160003004
11900110003005
15672900003006

 

Expected Result 

  • New Ratio column ranked highest to smallest
Money InMoney OutPostcodeRatio
15672900030061.74
220001300030031.69
130001100030021.18
119001100030051.08
119001100030051.06
156729000030060.73



Thank you for your response

Write this measure and drag it to the visual

Measure = divide(sum(Data[Money In]),sum(Money out))

Sort this measure in descending order.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur yeah thank I have that calc sorted but how do I go about sorting them dynamically and then get a list of the top 20 in dax?

Hi,

You may download my PBI file from here.  You will see the Top 3 Pincodes by ratio in descending order.  The Top 3 are obtained by a DAX measure.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur legend, thank you so much. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Top Solution Authors