Forum Discussion

toum's avatar
toum
Helper II
2 years ago
Solved

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'.

 

 

  • 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

     

  • Anonymous's avatar
    Anonymous
    2 years ago

    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.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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's avatar
    TheoC
    Community Champion

    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