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
toum
Helper I
Helper I

Dynamic Legend in Stacked column chart

Hello all, please I need help on this, how can I display a different legend based on the axis that is being shown in my Stacked column chart? For example, if we are viewing categories, the legend should be 'country,' and if the axis is 'code,' the legend should be 'state'.

 

toum_0-1705427668281.png

 

2 ACCEPTED SOLUTIONS
TheoC
Super User
Super User

Hi @toum 

 

You can use Field Parameters to achieve this. It's quite simple and easy to do. Instead of writing out instructions, you can take a look at this video on Youtube that will assist.  You can skip quite a bit of it as it's a bit lengthy!

 

https://www.youtube.com/watch?v=TLiqqIsk1CU

 

Hope this helps.

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

v-junyant-msft
Community Support
Community Support

Hi @toum ,

Parameter indeed enables dynamic changes in the x-axis and legend. 
Maybe you can also use bookmark to realize your effect. First, create a bookmark for the visual object when the axis is 'categories,' the legend is 'country' and then create another bookmark for the visual object when the axis is 'code,' the legend is 'state' and then You can create a button for each of the two bookmarks, and click on the button to switch between the views. As mentioned in this post:
Solved: chart type change on published bookmarks - Microsoft Fabric Community

Best Regards,
Dino Tao
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

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

Hi @toum ,

Parameter indeed enables dynamic changes in the x-axis and legend. 
Maybe you can also use bookmark to realize your effect. First, create a bookmark for the visual object when the axis is 'categories,' the legend is 'country' and then create another bookmark for the visual object when the axis is 'code,' the legend is 'state' and then You can create a button for each of the two bookmarks, and click on the button to switch between the views. As mentioned in this post:
Solved: chart type change on published bookmarks - Microsoft Fabric Community

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

TheoC
Super User
Super User

Hi @toum 

 

You can use Field Parameters to achieve this. It's quite simple and easy to do. Instead of writing out instructions, you can take a look at this video on Youtube that will assist.  You can skip quite a bit of it as it's a bit lengthy!

 

https://www.youtube.com/watch?v=TLiqqIsk1CU

 

Hope this helps.

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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.