Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
55 | |
38 | |
29 |
User | Count |
---|---|
78 | |
62 | |
45 | |
40 | |
40 |