Forum Discussion

ModernHand's avatar
ModernHand
Frequent Visitor
3 years ago
Solved

Dax color coding

Hello,

 

need help with custom colors on 1 column!

 

So the column is text based, all I need is 1 word inside text to be RED, everything else in cell must be black.

 

 

textcolumn = 

VAR  NEFAKT = (CURRENCY(Zmaje[Vrednost]) - CURRENCY(Zmaje[koncnavrednost]))
RETURN
FORMAT(Zmaje[Vrednost], "##,#0.00 € ") & (" Nefakt "& (FORMAT(NEFAKT, "##,#0.00 €")))

 

 

 

I need this to be RED

 

 

(FORMAT(NEFAKT, "##,#0.00 €")))

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi ModernHand ,

     

    According to your statement, I know that you want to custom color of your value based on specific words.

    I think you can try to create a measure.

    Measure = IF(CONTAINSSTRINGEXACT(MAX('Table'[Text]),"b"),"Red","Black")

    Then use conditional formatting in table or matrix to change the font color.

    For reference: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

     

    Best Regards,
    Rico Zhou

     

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

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ModernHand ,

     

    According to your statement, I know that you want to custom color of your value based on specific words.

    I think you can try to create a measure.

    Measure = IF(CONTAINSSTRINGEXACT(MAX('Table'[Text]),"b"),"Red","Black")

    Then use conditional formatting in table or matrix to change the font color.

    For reference: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

     

    Best Regards,
    Rico Zhou

     

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