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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear community:
Is there a way to use column and row values to color a matrix as a heatmap:
This is what I have:
And this is what I would like to get:
In this example, for color green I would use the following logic:
If value falls in column with value 0 OR 1 OR 2 OR 3 and in row with value 3 then green
Thanks in advance for your reply!
Solved! Go to Solution.
Yes @Netope
You can do, please create measure and apply as Background color conditional formatting
Step - Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
If you want to specific answer, please create a sample pbix and share the link (google drive, dropbox, onedrive)
Please share accurate logic for all color
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
Hi @Netope
As @PijushRoy mentioned, you can use conditionfal formatting.
You can refer to the following sample.
2.I create a matrix and put the following fields to the matrix.
3.Create a measure to set the condition of the color.
MEASURE =
VAR a =
SELECTEDVALUE ( 'Table'[BP Number] )
VAR b =
SELECTEDVALUE ( 'Table'[Number] )
RETURN
SWITCH (
TRUE (),
a = 0
&& b = 0, "grey",
a = 1
&& b <= 1
|| a < 1
&& b = 1, "red",
a = 2
&& b <= 2
|| a < 2
&& b = 2, "yellow",
a = 3
&& b <= 3
|| a < 3
&& b = 3, "green"
)
Then put the measure to the conditional formatting of the value field.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Netope
As @PijushRoy mentioned, you can use conditionfal formatting.
You can refer to the following sample.
2.I create a matrix and put the following fields to the matrix.
3.Create a measure to set the condition of the color.
MEASURE =
VAR a =
SELECTEDVALUE ( 'Table'[BP Number] )
VAR b =
SELECTEDVALUE ( 'Table'[Number] )
RETURN
SWITCH (
TRUE (),
a = 0
&& b = 0, "grey",
a = 1
&& b <= 1
|| a < 1
&& b = 1, "red",
a = 2
&& b <= 2
|| a < 2
&& b = 2, "yellow",
a = 3
&& b <= 3
|| a < 3
&& b = 3, "green"
)
Then put the measure to the conditional formatting of the value field.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks! let me try I'll get back to you
Yes @Netope
You can do, please create measure and apply as Background color conditional formatting
Step - Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
If you want to specific answer, please create a sample pbix and share the link (google drive, dropbox, onedrive)
Please share accurate logic for all color
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 102 | |
| 67 | |
| 65 | |
| 56 |