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
sivareddy123
Employee
Employee

Get Top 20 rows based on another column

Hello all I wonder if someone can help me.

 

I have a table of data which I would like to pull out the top 20 rows depending on a measure value. 

 Any advice would be fantastic

4 REPLIES 4
Andy100Rob
Advocate II
Advocate II

If you're not looking to write any code, then the filter functions might work for you.

 
 

Top N filter optionTop N filter option

 

Not sure if you have used these before, so:

 

Select the table, then head over to the Visualizations pane, under the Filters options, I've selected Customer Number and then the filter type of Top N.

 

You can then select how many you wish to filter, so I've gone with the Top 20

 

Then I've dropped a measure, GP GBP, into the By Value option.

 

Hope this helps.

 

Andy

 

v-lid-msft
Community Support
Community Support

Hi @sivareddy123 ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @sivareddy123 ,

 

If you want to pull out the 20 rows, we can just ues the following formula to create a calculated table, you can change the part of [Value]+[Value2] to yours, it will calculate for each rows in table.

 

Table 2 = 
TOPN(20,'Table',[Value]+[Value2],DESC)

7.PNG8.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Washivale
Resolver V
Resolver V

Hi @sivareddy123 ,

Try following Dax function to create a new table.

TOP20 = TOPN(20,SUMMARIZ(Table, Table[Column]), [Measure])

let me know if it works with your requirement.

Thank You,
Washivale

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.