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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.