Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Dax color formatting

Hello folks,

 

For a worldoverview I´m using the Global Launch Estimates map.

I needed an overview of the countries by color.

 

However, I want to add a column with the code of a specific color based on a value, see my example below:

 

Name             Value         Color

New York        1.001        Dax formula with Hex # codes from red to green based on value

Paris                900          Dax formula with Hex # codes from red to green based on value

Dublin             665          Dax formula with Hex # codes from red to green based on value

London           1.178       Dax formula with Hex # codes from red to green based on value

Barcelona       1.980       Dax formula with Hex # codes from red to green based on value

Madrid            2.095      Dax formula with Hex # codes from red to green based on value

Amsterdam     300         Dax formula with Hex # codes from red to green based on value

 

The codes needs to be based on the value and not on the name of the city.

 

Cheers!

  • Create measure for the color like below and use this measure in your value 

    Color = IF(
             value>0,

           "#F40606", "#252423")

     

     

     


     

2 Replies

  • Create measure for the color like below and use this measure in your value 

    Color = IF(
             value>0,

           "#F40606", "#252423")