Forum Discussion

GOGIANTS's avatar
GOGIANTS
Regular Visitor
4 years ago
Solved

Apply conditional formating to several values based on the highest number

Hello,

 

I am trying to creat a heatmap in PowerBI, I downloaded a custom visual but that one isnt great. I already created a heatmap/table in Excel (pivot table) and applied conditional formating to all the cells which should be included (see image) and it works great.

 

 

However, i can't get the same result in PowerBI where i apply conditional formating to all values. When add conditional formating for each value it calculates it also for each value (looks at the highest number in the column instead of entire table). The columns/data are the same in both (excel en powerbi), only difference is that I only loaded a small sample into powerbi.

 

 

If anyone got an idea, let me know 😄

  • negi007's avatar
    negi007
    4 years ago

    GOGIANTS in your case, you are adding seperate columns in values field that is why you have to apply conditional formatting seperatly for each columns. I suggest you to combine all these values into one columns using unpivot data feature in power query and then use that column in the value field. this can solve your problem. UnPivoting the data is very easy in power query, you select all columns and then unpivot option. This value create two columms, one for value and second for type of value.

     

    hope this solution solve your issue. thanks

  • I found the solution, instead of pivot i should unpivot the column which turned it into one value. Thanks for guiding in the right direction!

5 Replies

  • negi007's avatar
    negi007
    Icon for Community Champion rankCommunity Champion

    GOGIANTS what is the conditional that you wish to apply to your data. on what basis color formatting to be applied?

    • GOGIANTS's avatar
      GOGIANTS
      Regular Visitor

      With excel I just used the standard one (RED = HIGH, GREEN = LOW).

      • negi007's avatar
        negi007
        Icon for Community Champion rankCommunity Champion

        GOGIANTS in your case, you are adding seperate columns in values field that is why you have to apply conditional formatting seperatly for each columns. I suggest you to combine all these values into one columns using unpivot data feature in power query and then use that column in the value field. this can solve your problem. UnPivoting the data is very easy in power query, you select all columns and then unpivot option. This value create two columms, one for value and second for type of value.

         

        hope this solution solve your issue. thanks