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
Mighaz
Regular Visitor

Creating a Top N Measure with Filters

Hello Everyone,

 

I am newbie at PowerBI and stuck at an issue. I have a huge dataset of sales at outlet level. 

I have the following list of columns in my data: Year, Month, Outlet Number, City, Store Type, Sales Developer Name, Area Sales Manager Name, Category (Juice, water etc.), Brand, Package Group (Plastics, steel etc.), Package size (500 ML, 1000 ML etc.)


My end target is to create a measure titled "Top 10%-2017' which would return sales from top 10% of the outlets. Ideal output should look something like this for the selection of city wise sales:

 

asdasd.JPG

The criteria for Top 10% outlets is the following:

 

All outlets should be ranked based on their overall sales for the full year 2017, but should return sales for whatever metric is selected. For instance if I want to see what are the sales of 500 ML packs in the Top 10% outlets then I should be able to do that via this measure.

 

Any help would be very much appreciated.

 

Thanks in advance.

 

 

 

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

@Mighaz,

 

You may learn to use RANKX Function.

https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/

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

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Mighaz,

 

You may learn to use RANKX Function.

https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/

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.

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.