Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Dynamic Color visualization

Hello experts, 

If I have a slicer for country, and If I click India, then the  color of visuals become Red, then if I click China, then color of viusulas become Blue, How I can do that in Powerbi. 

  • Anonymous  i am not clear where you wish to have the condinal color. but let's say you have a visual and you wish to change the header background color change basis selection in the slicer

     

    let's say i have a data like below and last column value to be used to change the color dynmically

     

    i have created below visual where header background will change basis selection in the country slicer.

     

    i have set the background color condition like below 

     

    let me know if it helps you

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    To my knowledge, report themes could not be dynamically changed based on different selections/filters.

    Ideas similar with what you expect have been submitted in the following links, please vote them up and you can add comments. Hopes Power Bi will implement this in nearby future.

    Dynamic theme

    Dynamic Themes Based on Slicer Selection

    Dynamically change theme from data/slicer selection

    slicer themes

     

     

    My workaround is to create a color measure ,and then apply it to each visual's Value Color field.

    Measure = SWITCH( SELECTEDVALUE('Table'[Country]) ,"India","Red","China","Blue","UK","Yellow")

     

     

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

4 Replies

Replies have been turned off for this discussion
  • negi007's avatar
    negi007
    Community Champion

    Anonymous  i am not clear where you wish to have the condinal color. but let's say you have a visual and you wish to change the header background color change basis selection in the slicer

     

    let's say i have a data like below and last column value to be used to change the color dynmically

     

    i have created below visual where header background will change basis selection in the country slicer.

     

    i have set the background color condition like below 

     

    let me know if it helps you

     

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      for Example this visula, I have more than 10 countries in slicer, is there dax code can make when I click in slicer in each counrtym it give the color that definded befor for each country.

      Example: 
      India - all visulas will be in red color.

      China - all visulas will be in Blue color.

      and so on.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    To my knowledge, report themes could not be dynamically changed based on different selections/filters.

    Ideas similar with what you expect have been submitted in the following links, please vote them up and you can add comments. Hopes Power Bi will implement this in nearby future.

    Dynamic theme

    Dynamic Themes Based on Slicer Selection

    Dynamically change theme from data/slicer selection

    slicer themes

     

     

    My workaround is to create a color measure ,and then apply it to each visual's Value Color field.

    Measure = SWITCH( SELECTEDVALUE('Table'[Country]) ,"India","Red","China","Blue","UK","Yellow")

     

     

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