Forum Discussion

ts94's avatar
ts94
New Member
1 year ago
Solved

Display legend for conditional formatting

Hi,

 

I have created a treemap and applied some conditional formatting for the color in that treemap. When setting the legend to show, it only shows me in which color the corresponding category was colored but not based on which rule. I applied color gradient for the conditional formatting btw, so it should be fairly easy to display that as a legend, technically at least. In Tableau this was always very easy. Maybe someone knows a way? Or is this simply not possible in PowerBI?

 

Following screenshot shows my example a bit more in detail:

The country is my category and then the tiles sizes are based on application number. The color however is a conditional formatting based on a conversion ratio. And you can also see that the legend shows exactly what I have explained above. I would rather want to see a bar that shows the gradient from 0% to 100% conversion ratio.

 

Thanks!

BR,


Tim

 

  • ts94 I just did this in my Power BI World Championship EU submission. Life in Europe by Greg Deckler - Microsoft Fabric Community. It is on the Interactive Explorer. page.

     

    In the conditional formatting area, clip the gradient and place it on the page over top of the legend area. Bit hacky but works well. I also created measures for min and max and used Card visuals overlaying the gradient at both ends.

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ts94 I just did this in my Power BI World Championship EU submission. Life in Europe by Greg Deckler - Microsoft Fabric Community. It is on the Interactive Explorer. page.

     

    In the conditional formatting area, clip the gradient and place it on the page over top of the legend area. Bit hacky but works well. I also created measures for min and max and used Card visuals overlaying the gradient at both ends.

    • ts94's avatar
      ts94
      New Member

      Hey Greg,

       

      thanks for your suggestion. Just so that I am sure I get it right: You say I should screenshot the gradient and then insert card visuals to display the bottom and top of the gradient? I mean sounds very creative and sure it works fine but it is a bit sad that this is what you have to go down in order to display something very simple. 😄 I start disliking PowerBI a bit compared to Tableau to be honest 😄

       

      BR,


      Tim

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        ts94 Oh, trust me, everything in Power BI is a complete and utter hack.

  • Hi ts94 

     

     This isn't possible in the standard treemap visual, gradient legends are only supported in bar charts, scatter charts and maps.

     

     

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi ts94 ,

    Thank you for reaching out to Microsoft Fabric Community.

    Thank you Greg_Deckler wardy912 for the prompt response.

    Thank you for confirming that the suggestions provided by Greg_Deckler  helped in resolving the issue. Please let us know if you have any further question, we would be happy to address.