Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi I need help with formatting of matrix table like below.
Do you want expected output as below? I created a solution as below:
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.
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,
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,
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).
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 ;). |
Its coming like below
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 ;). |
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)
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.
To format each region's background color (like East = blue, South = green):
In Fields pane, right-click your value (under Values) → Conditional formatting → Background 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