March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello
I work with Power Bi Desktop RS.
I want a dynamic background color.
I explain myself with the image below:
I want the lines of area 1, 3 and 5 to be with a red background color.
and the lines of zone 2 and 4 with a yellow background color.
any idea how i can do this please?
thanks in davance
Solved! Go to Solution.
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
Proud to be a Super User!
Paul on Linkedin.
Hello you need go to the field select the Conditional background and in Format style Select Rules, and just put your requirements
Regards
I just wish alternate matrix row colors .
Conditional background does not allow colors to be alternated.
Can you send us one example that you want in excel?
i want have dynamique alternate matrix row colors (orange/blue) like this :
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"
)
)
)
Proud to be a Super User!
Paul on Linkedin.
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
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
Proud to be a Super User!
Paul on Linkedin.
in my Power Bi Desktop RS, the CF variable is grayed out, I can't select it :
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
Proud to be a Super User!
Paul on Linkedin.
I increased the measure in the conditional formatting. but the display is not at the top :
here is the script used :
Me_CF2 =
VAR _Rnk =
IF (
ISBLANK ( [S-Revenue_actual] ),
BLANK (),
CALCULATE (
RANKX ( ALLSELECTED ( DIM_PRODUCT ), [S-Revenue_actual],, DESC ),
ALLEXCEPT ( DIM_PRODUCT, DIM_PRODUCT[pr_offer] )
)
)
RETURN
IF (
NOT ISINSCOPE ( DIM_PRODUCT[pr_offer] ),
"White",
IF (
NOT ISINSCOPE ( Dim_Time[Period] ),
"White",
IF (
AND ( ISINSCOPE ( DIM_PRODUCT[pr_offer] ), ISEVEN ( _Rnk ) ),
"#EFB5B9",
"#A0D1FF"
)
)
)
ok. very Big thanks for you help.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |