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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.