This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I want to make a function for the background color of cells in a matrix.
Data are like this
I am trying to put the background color of Q73_lib cells with Q72_correspondance.Q72_lib_color
With conditional Formatting what I have tried so far didn't worked :
Solved! Go to Solution.
Hi @amitchandak
Thank you for your answer.
It's hard to put it in the matrix.
In line, I have a series to rank my measure :
Clement
Hi @clem312
In your measure, it performs conditional formatting based on Q72_correspondance.Q72_id_color, but this column is not added in your matrix. So if this column can't be added to the matrix, you should look for other column to replace it. Otherwise, it is difficult to perform conditional formatting.
For more details about conditional formatting, you can review this article,
https://www.sqlshack.com/conditional-formatting-in-power-bi-2/
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thank you. Finally worked.
I created a measure MIN(Id_color) in my table and Background color and it worked ! Even without adding id_color in the matrix
Hi @clem312
In your measure, it performs conditional formatting based on Q72_correspondance.Q72_id_color, but this column is not added in your matrix. So if this column can't be added to the matrix, you should look for other column to replace it. Otherwise, it is difficult to perform conditional formatting.
For more details about conditional formatting, you can review this article,
https://www.sqlshack.com/conditional-formatting-in-power-bi-2/
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-xiaotang
Even inserting Q72_correspondance.Q72_id_color in the matrix doesn't change the background color.
Hi @clem312
Thanks for your feedback. Could you show me how you set conditional formatting in matrix?
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @amitchandak
Thank you for your answer.
It's hard to put it in the matrix.
In line, I have a series to rank my measure :
Clement
@clem312 , In this case, Q73[Q72_correspondance.Q72_id_color] should be used in the matrix (or min of the context will be used)
Try like this. Used this measure in conditional formatting using the field values option
Q73_Background Color =
Switch (true() ,
MIN(Q73[Q72_correspondance.Q72_id_color])=1,"#ff99cc",
MIN(Q73[Q72_correspondance.Q72_id_color])=4,"#ccccff",
MIN(Q73[Q72_correspondance.Q72_id_color])=5,"#ffcc99"
)
PowerBI Abstract Thesis: How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 27 | |
| 24 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 50 | |
| 33 | |
| 24 | |
| 24 |