Forum Discussion

PaisleyPrince's avatar
PaisleyPrince
Advocate II
1 month ago
Solved

Conditional formatting in power bi matrix row headers

Hi, I have a power bi matrix where the values have conditional formatting with icons however i'd also like the rows to use conditional formatting with icons. For example if the rows contain country...
  • Shai_Karmani's avatar
    1 month ago

    The cleanest way is to build a calculated column in your country/dim table that concatenates the country name with the currency symbol using UNICHAR, then put that column on the matrix rows instead of the plain country name.

    Something like:

    CountryLabel =
    Countries[Country] &
    SWITCH(TRUE(),
        Countries[Country] = "United Kingdom", " " & UNICHAR(163),
        Countries[Region] = "Europe", " " & UNICHAR(8364),
        ""
    )

    UNICHAR(163) is £, UNICHAR(8364) is €, UNICHAR(36) is $, and so on. Countries that don't match any condition just show their name with no symbol, which sounds like what you described.

    If sort order matters, keep the original country column in the table and set Sort By Column on your label to the plain country name so it still sorts A to Z.

    The conditional formatting Icons feature on a matrix works off measure values, so it won't let you mix symbols per row the way you want. Concatenation is the practical route.

     

    If this helped, a thumbs up and marking it as the accepted solution would be appreciated.

     

    Thanks,
    Shai Karmani

     

    Let's connect in LinkedIn