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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
C_Lee
Helper I
Helper I

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/

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/

@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/

@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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors