Forum Discussion
Alternate matrix row colors
- 3 years ago
Sorry, I don't have Report Server installed, so I cannot test it. Maybe try on the Report Server forum?
https://community.powerbi.com/t5/Report-Server/bd-p/ReportServer
- 3 years ago
ok. very Big thanks for you help.
Can you send us one example that you want in excel?
i want have dynamique alternate matrix row colors (orange/blue) like this :
- PaulDBrown3 years ago
Community Champion
At present, you cannot conditional format row headers. So this is the closest I've got:
Using a measure for the conditional formatting (& manual formatting of column and row totals) along the lines of:
CF = IF ( NOT ISINSCOPE ( Data[Pr offer] ), "White", IF ( NOT ISINSCOPE ( Data[Year - Month] ), "White", IF ( SELECTEDVALUE ( Data[Pr offer] ) IN { "Bi & Data", "Business Consulting", "Infrastructure" }, "#EFB5B9", "#A0D1FF" ) ) )- David233 years agoFrequent Visitor
Thank you for your reply. I have 2 question plz :
1- how to assign CF measure to my matrix?
2- the list IN { "Bi & Data", "Business Consulting", "Infrastructure" } can grow or shrink depending on what is going to be in the database. is it possible to make this line of script dynamic?
thanks in advance
- PaulDBrown3 years ago
Community Champion
1. The CF measure is a conditional formatting measure, so add it to the measure in the matrix.
2. First of all, I have set up dimension tables for the different fields.
Instead of hardcoding the values, you can include a rank measure together with the ISEVEN function to colour the even rows in one colour and the odd rows another colour in the CF measure as follows:
CF = VAR _Rnk = IF ( ISBLANK ( [SUM Sales] ), BLANK (), CALCULATE ( RANKX ( ALLSELECTED ( 'Pr Offer Table' ), [SUM Sales],, DESC ), ALLEXCEPT ( Data, 'Pr Offer Table'[Pr offer] ) ) ) RETURN IF ( NOT ISINSCOPE ( 'Pr Offer Table'[Pr offer] ), "White", IF ( NOT ISINSCOPE ( Data[Year - Month] ), "White", IF ( AND ( ISINSCOPE ( 'Pr Offer Table'[Pr offer] ), ISEVEN ( _Rnk ) ), "#EFB5B9", "#A0D1FF" ) ) )Sort the matrix by sales in descending order and you will get:
Sample PBIX file attached