Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Conditional formatting per rows in a matrix

Dear Community,
I want to color rows of matrix,
As you can see in the pics, I have a matrix with rows C and S, How do I conditional formatting each row in the matrix? ( The issue is that I do not want "S" be a value in matrix, Otherwise if it was value I simply make it colorful by conditional formatting)
matrix.PNGCS.PNG

Thanks in advance

6 REPLIES 6
V-pazhen-msft
Community Support
Community Support

@Anonymous 
You can create a flag measure with IF() or Switch() on S to give each category a value, then use the measure to value in the conditional format: 

 

Something like: 

Measure (s) =Switch(True(),
[S] = "xxx", 0,
[S] = "xxxx",1,

...))

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , in case C and S are rows. C will only come as sub total.

Not very clear on need , You can create a color measure

like

if(isinscope(Table[C]), "green", "white")

and you can use them in conditional formatting (for each value) using "Field value" option

 

Other way


Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)

Measure =
Switch(true(),
max(Table[status]) = "In production" , "Red" ,
max(Table[status]) = " Product completed" , "Green" ,
"blue "
)

 

How to color

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

isinscope

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Anonymous
Not applicable

Thanks @amitchandak 

Could you please explain more, I should add that I have measure, which called ROL, based on the result of that measure which produces -1,0,1  I need to color each row, If ROL=1, row should be green, etc, 
is this possible in power BI ? 

@Anonymous , You can return color when Based on the value of measure or gorup by.  and the use this new measure in conditional formatting. There if you choose field value. you can give color measure. Give this for all values of matrix . There is no row color in power bi

 

This video is for card. But option is true for matrix

https://youtu.be/veCtfP8IhbI

Anonymous
Not applicable

@amitchandak 
So, Do you mean I should set field value for all values in matrix? 
If yes, SO its impossible as I have more than 1000 diffrent values in my matrix.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.