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

Dynamic TopN Ranking using Parameters for Ribbon Chart

Hi All,

 

 

I have a Ribbon Chart displaying Volumes by Years and Products.

X-axis - Years (last 5 years)
Y-axis - Volumes
Legend - Products

The issue is the number of products – I have 3,500 different products, which limits their visibility. I want to give users the option to choose the Top Products, for example, Top 50, 100, 150, 200, etc. I’ve created a separate table with measures and a Total Volumes measure that works based on a parameter (allowing the user to select the number of Top Products to view in a slicer). I also have other filters, like Region, Customer Name, and Account Manager, so I’d like the chart to display the Top Products based on the selected parameter value while reflecting these other filters as well.

I managed to implement this solution on a standard table where I have the product name in the first column and the summed volume for each product in the second column. Here, everything works perfectly. The issue arises when I try to apply the measures and parameter to the ribbon chart. Since I have data in both the X-axis and Y-axis, the filtering doesn’t work correctly – the years on the X-axis are causing problems. When applying a parameter, such as Top 10, the chart shows far more than 10 products.

Do you have any suggestions to work around this? Ideally, I’d like the chart to display products with total volumes summed over the 5 years, ranked from highest to lowest. Is it even possible to achieve this with a ribbon chart?

Many thanks in advance for any tips!

2 ACCEPTED SOLUTIONS
AleksandraLel
Regular Visitor

Dear @mark_endicott ,

Many Thanks for your reply. You can find the sample data here:

 

https://www.dropbox.com/scl/fi/eze5fyrox5oo4galvyha2/RibbonChart.pbix?rlkey=4zzxqcrqt2aomhvr0mtkygv8...

 

I have to mention also that the Top N Filter built based on the Parameter should work dynamicaly with changing other filters as Region, Sales Rep responsible for a given Region, Customer Name etc.

Thanks!

View solution in original post

@AleksandraLel - I've added a new measure to your file, which will point you in the right direction. To factor in the other dimension filters, you will just need to add them into the last ALLSELECTED separated by commas. 

 

DAX below, file attached. 

 

Dynamic TopN Volume = 
VAR vol = [TotalVolume]
RETURN
    IF (
        CALCULATE (
            RANKX ( ALLSELECTED ( Sheet1[Product Name] ), [TotalVolume] ),
            ALLSELECTED ( Sheet1[Year] )
        ) <= TopNProducts[TopNProducts Value],
        vol
    )

 

If this works for you please accept it as the solution, so others with the same issue can find the resolution. 

View solution in original post

5 REPLIES 5
AleksandraLel
Regular Visitor

Dear @mark_endicott ,

Many Thanks for your reply. You can find the sample data here:

 

https://www.dropbox.com/scl/fi/eze5fyrox5oo4galvyha2/RibbonChart.pbix?rlkey=4zzxqcrqt2aomhvr0mtkygv8...

 

I have to mention also that the Top N Filter built based on the Parameter should work dynamicaly with changing other filters as Region, Sales Rep responsible for a given Region, Customer Name etc.

Thanks!

@AleksandraLel - I've added a new measure to your file, which will point you in the right direction. To factor in the other dimension filters, you will just need to add them into the last ALLSELECTED separated by commas. 

 

DAX below, file attached. 

 

Dynamic TopN Volume = 
VAR vol = [TotalVolume]
RETURN
    IF (
        CALCULATE (
            RANKX ( ALLSELECTED ( Sheet1[Product Name] ), [TotalVolume] ),
            ALLSELECTED ( Sheet1[Year] )
        ) <= TopNProducts[TopNProducts Value],
        vol
    )

 

If this works for you please accept it as the solution, so others with the same issue can find the resolution. 

Hi @mark_endicott ,

Sorry for my late reply and thank you for your help! It works fine, I have accepted the solution 🙂

Aleksandra

@AleksandraLel - No problem, happy to help!

mark_endicott
Super User
Super User

@AleksandraLel - Can you provide your DAX and some sample data please?

 

This is unsolvable without. 

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.