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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Poornima2023
Helper I
Helper I

Help with conditional formatting in power bi

Hi I need help with formatting of matrix table like below.

Format.png

 

11 REPLIES 11
sivarajan21
Post Prodigy
Post Prodigy

Hi @Poornima2023 

 

Do you want expected output as below? I created a solution as below:

sivarajan21_0-1758108283837.png

we can color the region and all columns as shown above image.

Please let me know and i will inform the solution for you

 

 

Please help. Also note its not table its matrix.

Hi @Poornima2023 

 

I have a workaround for this if you don't have python installed.

We can create a SVG specification:

1. Create an SVG specification that includes a rectangle shape and a text element within it.
2. Create a conditional column in Power Query and place your specification in that column. Replace the text value in the SVG code with the column you want to add to your matrix row header. Also, replace the rectangle shape’s fill color with the color you want to use for that category. (You may need to write conditional logic using an IF statement to make it dynamic.)
3. Change the category of this column to "Image URL."
4. You can then place it in your matrix row header.

 

If you want i can implement this and give you the code and result

 

Please let me know!

Best Regards,

Hi @Poornima2023 

 

Sure! 

I used plotly chart using python script to achieve this

You need to just click the PY in visualization and type in below code on scripts to achieve this. 

Before that do you have python installed on your machine?

Currently power bi doesn't provide formatting on all columns

 

Please let me know

 

Best Regards,

KNP
Super User
Super User

Region and Branch cannot be formatted, unfortunately. Matrix visuals don't allow it.

A-E and Total can be.

See example screenshot, using a measure to define the rules and then applying to the matrix on EACH of your columns (individually).

KNP_0-1758050446065.png

 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

Its coming like below

Poornima2023_0-1758085933844.png

 

Hi @Poornima2023 ,
As @KNP mentioned earlier, conditional formatting cannot be applied to row headers such as Region and Branch in the matrix visual, so those fields cannot be colored. For any blanks that appear, you can adjust your measure logic to replace them with 0 or another value, which will help ensure conditional formatting is applied consistently.

Hope this helps, and thank you for your response, @KNP .

Thanks tried it. Blanks in every region are coming white and also color is not coming on Region and branch

As I mentioned in my comment, region and branch cannot be conditionally coloured. 

The blanks you may need to change the blanks to zeros or a blank string. 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!
anilgavhane
Resolver II
Resolver II

1. Add Matrix Visual

  • Open Power BI Desktop.

  • From Visualizations, choose Matrix.

  • Drag fields:

    • Rows: Region, then Branch

    • Columns: A, B, C, D, E (add these under Columns)

    • Values: Your metric (e.g., count or total value)


2. Enable Subtotals and Grand Totals

  • Select the Matrix.

  • Go to Format pane (paint roller icon).

  • Expand Subtotals:

    • Turn Row subtotals ON.

    • Set Per row level to ON if needed.

  • Expand Grand total:

    • Turn ON Row and Column totals if not already.


3. Apply Background Color by Region

To format each region's background color (like East = blue, South = green):

Method 1: Using Conditional Formatting
  • In Fields pane, right-click your value (under Values) → Conditional formattingBackground color.

  • Choose Format by: Field value or Rules

  • Use a helper column in your data model that maps Region to color (e.g., East = light blue, South = light green, etc.)

  • Or manually create rules like:

    • If Region = East → light blue

    • If Region = South → light green

    • etc.

Thanks but its not working

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Kudoed Authors