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
kan
Helper I
Helper I

Matrix Custom Color

Hi I have a Matrix Visual in power BI as follows

 

RGYNovemberDecember
Green280.516064229.5032663
Red59.28986904378.0103653
Yellow53.54121154

20.87497543

 

In Visualization Pane Rows=RGY,  Columns=MonthName,  Values=ProductQty

 

I need to show it as If RGY=Green then entire Row should be green,if red then entire row should be Red and so on..

 

Is this possible,if so Can someone please explain.

 

Thanks..

1 ACCEPTED SOLUTION

Hi @kan,

It's not possible to change the headers and totals based on a dinamic colour per line, conditional formating only availabl on values of matrix and tables.

Regards
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @kan,

 

Currently in PBI matrix and tables it's possible to connect a colour field to the condittional formatting in this way you can define the colour on your database and then return that to the matrix visualization however this will only apply to the data not to the headers of the rows or totals.

 

You need to do the following:

  • Add the following measure to your model:

 

ColourCode = SWITCH(SELECTEDVALUE(Table1[RGY]);
            "Green";	"#01B8AA";
            "Red";	"#FD625E";
         "Yellow";	"#F2C80F")
  • On the matrix select the conditional formatting, background colour
  • Format by Field Value:
  • Based on field select the measure ColourCode
  • Your table is filled with the colours you want.

colorcode.gif

 

You can change the color codes by the ones you want you just need to keep the # before the codes.

 

Check the detail and explanation of this feature in the link.

 

Regards

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix,

                 Thank you.It worked for me.I downloaded latest version of power bi desktop to use conditional formatting based on field values.Also I have one more question ,is it possible to make RGY field names background  as Green,Red  .I mean the whole rows instead of just field values?

 

Thanks

Kan

Hi @kan,

It's not possible to change the headers and totals based on a dinamic colour per line, conditional formating only availabl on values of matrix and tables.

Regards
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.