- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternate matrix row colors
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!
Proud to be a Super User!
Paul on Linkedin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello you need go to the field select the Conditional background and in Format style Select Rules, and just put your requirements
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just wish alternate matrix row colors .
Conditional background does not allow colors to be alternated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you send us one example that you want in excel?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i want have dynamique alternate matrix row colors (orange/blue) like this :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
)
)
)
Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!
Proud to be a Super User!
Paul on Linkedin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!
Proud to be a Super User!
Paul on Linkedin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in my Power Bi Desktop RS, the CF variable is grayed out, I can't select it :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!
Proud to be a Super User!
Paul on Linkedin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
)
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok. very Big thanks for you help.
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
10-02-2024 01:38 PM | |||
03-11-2024 04:02 PM | |||
12-17-2022 08:03 AM | |||
08-28-2024 08:47 AM | |||
08-31-2024 04:15 AM |
User | Count |
---|---|
126 | |
79 | |
60 | |
58 | |
44 |
User | Count |
---|---|
181 | |
121 | |
82 | |
70 | |
54 |