Forum Discussion
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 names, i'd like the country name plus a euro sign if they are in europe and if UK - followed by a pound sign etc. Not all countries would have their name followed by an icon.
Would you be able to advise the easiest way to achieve this ?
Many thanks
Scott
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
6 Replies
- Shai_KarmaniSuper User
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 - Kagiyama_yutakaResponsive Resident
The matrix only applies icon formatting to values, and the way to show a currency mark on a row header is a DAX column that returns the country text plus the Unicode symbol and you place that column in the row header.
- v-sathmakuriCommunity Support
Hi PaisleyPrince ,
Thanks for reaching out to fabric community.
Could you review the suggestion provided by Kagiyama_yutaka and Shai_Karmani and let us know if you have any additional questions, we are happy to address.
Thanks!!
- danextianSuper User
Conditional formatting for row and column headers is not currently supported. As a workaround, you'll need to prepare the header values in advance and use a measure to control which row values are displayed or hidden based on your desired conditions. Keep in mind that this adds extra columns or tables to the semantic model and introduces additional DAX logic, which can increase model complexity. Depending on the amount of data and the complexity of the measures, it may also have a noticeable impact on report performance.
- Ganesh06Frequent Visitor
Hi,
Yes, this is possible, but there are a few limitations to be aware of.
Power BI currently supports icon conditional formatting for values in a Matrix, but row header fields (such as Country) don't support conditional formatting with icons directly.
A few common workarounds are:
- Create a calculated/display column that appends a Unicode symbol to the country name (for example, France €, United Kingdom £). This is the simplest approach if you only need static symbols.
- Use a DAX measure or calculated column to return the display text based on your business rules (for example, append € for European countries, £ for the UK, and leave other countries unchanged).
- If you need richer visual indicators (such as colored icons or images), consider using a custom visual or redesigning the report with an additional indicator column, since native row headers don't support icon conditional formatting.
So, while native icon conditional formatting isn't available for Matrix row headers, using a calculated display field is generally the easiest and most maintainable solution.
Hope this helps!
- v-sathmakuriCommunity Support
Hi PaisleyPrince ,
Could you please review the solution provided above and let us know if you have any further questions.
Thanks!!