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
marijane
Helper I
Helper I

limit TOPN

Hi  everyone,

 

I want the top ten products by value so I filter the top N 10 on visual  and the table only shows the ten products by value which is right. The problem is when I add columns to the table like below.  The table shows many more rows. I only want the top 10 by product but showing the other columns. Can you help?

marijane_0-1607004919200.png

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @marijane ,

 

Is this the problem?

v-lionel-msft_2-1608108125998.png

Please refer to my .pbix file.

v-lionel-msft_3-1608110212818.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @marijane ,

 

Is this the problem?

v-lionel-msft_2-1608108125998.png

Please refer to my .pbix file.

v-lionel-msft_3-1608110212818.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Amazing! Thank you so much!

marijane
Helper I
Helper I
v-lionel-msft
Community Support
Community Support

Hi @marijane ,

 

How about doing like this?

v-lionel-msft_0-1607329192804.png

If it's helpless, please show me your .pbix file or sample data.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

The problem is that there is a repetition in many columns that's why it is adding more rows. I send you a sample.  In this case, I want the Top 2 but there are 3 rows instead of 2 (because of the repetition of one column).

 

Thank you in advance 🙂

marijane
Helper I
Helper I

Hi @amitchandak , thank you for your reply. The columns that I have to add are not from the same table, all the columns are from different tables. Can you be more clear please?

amitchandak
Super User
Super User

@marijane , IN case of Rank and TOPN if you take any other column then product, then Rank will be inside that /those columns . So either you should consider then in rank/top n or do not use in visual

 

example

Geography Rank = RANKX(all(Geography[City]),[Sales])  // with City ID give Rank =1  only
Geography Rank = RANKX(all(Geography),[Sales])  // work with City id as city and City id are both unique
City and ID Rank = RANKX(all(Geography[City],Geography[City Id]),[Sales]) // work with City id as  as both included

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

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.