Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 months ago
Solved

Conditional Format Font Colour and Change Format of Value

Hi all,

 I have a measure for finding Variance, however, I need the negative to look like this (312) with red as the font.

This is the dax for changing the format however when I try and conditionally format the measure it throws out an error saying it cannot do this for text based measures.
Format(([RF Day] - [Budget Day]), "#0,0;(#0,0);0")
Any ideas how I can do this??
Thanks
  • Hello Anonymous ,

     

    Please check FORMAT Function. It returns Text. So your number becomes a text and text measures cannot be conditionally formatted.

     

    You should create a numeric variance measure:

    Variance =[RF Day] - [Budget Day] It is numeric.

     

    After that, select the variance measure from the data pane and a new pane will open up at the top. You will see format. Enter that #,0;(#,0);0 in there.

     

    Now you can apply conditional font color, if value <0 Red etc.

     

    If this solved your issue, please mark it as the accepted solution. ✅

4 Replies

  • Hello Anonymous ,

     

    Please check FORMAT Function. It returns Text. So your number becomes a text and text measures cannot be conditionally formatted.

     

    You should create a numeric variance measure:

    Variance =[RF Day] - [Budget Day] It is numeric.

     

    After that, select the variance measure from the data pane and a new pane will open up at the top. You will see format. Enter that #,0;(#,0);0 in there.

     

    Now you can apply conditional font color, if value <0 Red etc.

     

    If this solved your issue, please mark it as the accepted solution. ✅

    • Anonymous's avatar
      Anonymous
      Not applicable

      That is great, that has helped a lot, cannot believe I didn't think to write the format in the box....
      Thank-you for your help