Forum Discussion

cristianml's avatar
cristianml
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Format number color with dax

Hi,

 

I want to format number and color with dax. It works with "0,,M" but also I want to change the color.  Could you help me to fix the following ?

 

VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M" & "#00d600")

 

 

Thanks

  • Hi, cristianml 

     

    Formatting numbers and setting colors need to be separated into two Dax. I briefly simulated some data hoping it would fit your situation.

    Measure1:

    VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M")

    Measure2:

    Color = 
    IF([VAR VAR1]="Revenue Actual:" & FORMAT([Actual Revenue], "0,,M"),"#00d600")

    Then select the field to which you want to apply the color. Select the font color in conditional formatting.

    The color needs to be set separately with Measure.

     

    Best Regards,

    Community Support Team _Charlotte

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

2 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, cristianml 

     

    Formatting numbers and setting colors need to be separated into two Dax. I briefly simulated some data hoping it would fit your situation.

    Measure1:

    VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M")

    Measure2:

    Color = 
    IF([VAR VAR1]="Revenue Actual:" & FORMAT([Actual Revenue], "0,,M"),"#00d600")

    Then select the field to which you want to apply the color. Select the font color in conditional formatting.

    The color needs to be set separately with Measure.

     

    Best Regards,

    Community Support Team _Charlotte

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