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
Anonymous
Not applicable

Display all items and Top N based on user input

Hi Team,

 

I am trying to build Power BI report to display all sales in a month and when selected with user level filter need to display top 10, 50 and 100 sales by city.

Can you please help providing some examples with DAX functions

 

 

2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

Here is an article for your reference.

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415

Community Support Team _ Sam Zha
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

@Anonymous

 

you can use this formula to achive your query...

 

Rank = IF(ISBLANK([TopN SubCat]), BLANK(), RANKX(ALLSELECTED(Orders[Sub-Category]), [Total Sales]))

 

TopnN-Rank.jpg

 

If it is solution to your query, Pls accept as solution.. it is helpfull to others...

 

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

Here is an article for your reference.

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Sam,

 

Thanks for the solution, It worked.

however is it possible to show rank values like 1,2,3,4 for the same in new column

@Anonymous

 

you can use this formula to achive your query...

 

Rank = IF(ISBLANK([TopN SubCat]), BLANK(), RANKX(ALLSELECTED(Orders[Sub-Category]), [Total Sales]))

 

TopnN-Rank.jpg

 

If it is solution to your query, Pls accept as solution.. it is helpfull to others...

 

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.