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
wenners68
Helper II
Helper II

Static X-axis in stacked column chart

Hi,

I have a measure that calculates the Top 5 countries for a selected year. It works fine if I use a table or matrix, but I want to use it in a column chart. Is there a way to be able dynamically get the label in the X-axis to change when I filter the data?
If I was to select 2022, the table would show Japan at the top and the USA in 3rd place, but column chart will only change the total value, whereas I want those labels to change as well. 

 

wenners68_0-1696837639794.png

 

2 ACCEPTED SOLUTIONS

Hi @wenners68 

It sounds like you are using a static top n functionality.
Take a look at the linked tutorial about dynamic way :

https://www.youtube.com/watch?v=vnqLb-IqLeQ

it should help.

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

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

if I understand you correctly and the graph is hierarchical, try to use the linked method :

https://dataninjago.com/2017/12/11/dax-ranking-with-hierarchy-drill-down/

or as I said in my first response: Please share some dummy pbix to work with

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
rubayatyasmin
Super User
Super User

Hi, @wenners68 

 

check your Edit interaction option. Set it the way you for both the visual and the slicer. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Ritaf1983
Super User
Super User

Hi @wenners68 

The question is unclear, the graph and table, are using the same logic...

Please share some dummy pbix to work with and more details about the problem ...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi,

Sorry, figured it out.

 

Hi @wenners68 

It sounds like you are using a static top n functionality.
Take a look at the linked tutorial about dynamic way :

https://www.youtube.com/watch?v=vnqLb-IqLeQ

it should help.

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

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi,

No, I used this measure:

Top 5 Country Sales =
IF(ISFILTERED(AllSales[Country]),IF([Country Rank] <= 5,[Total Sales],BLANK()),CALCULATE([Total Sales],TOPN(5,VALUES(AllSales[Country]), [Total Sales])))
 
The issue was that I had a column chart showing the total sales per year, and when I clicked on one of the years, I expected that to work the same way as selecting a year in a slicer. That doesn't work for some reason. But it works perfectly if the year is selected in the slicer 🙂

if I understand you correctly and the graph is hierarchical, try to use the linked method :

https://dataninjago.com/2017/12/11/dax-ranking-with-hierarchy-drill-down/

or as I said in my first response: Please share some dummy pbix to work with

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.