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! It's time to submit your entry. Live now!
I've got a matrix table with actual values in it. I am trying to format each individual value based on targets from a seperate table. this is the mesure i've made to format this.
OilLightsFormatting = IF( SUM(LossByCodeActual[Values]) > SUM(LossByCodeTargets[Values]), "Red", "Green")i've used similar in the past with no issues. this time though, it only makes the values in the matrix all the same color. this is a sample of what my tables look like.
I dont believe it's a relationship issue. both tables are formatted the same and have the same code column. many to many relationship. any ideas what i'm doing wrong or how to get this formatting to work? thanks
Solved! Go to Solution.
Hi @HDD328
For your question, here is the method I provided:
Here's some dummy data
“LossByCodeActual”
“LossByCodeTargets”
Create a measure.
OilLightsFormatting =
var _code = SELECTEDVALUE('LossByCodeActual'[Loss By Code])
RETURN
IF(
SUM('LossByCodeActual'[Values]) >
LOOKUPVALUE('LossByCodeTargets'[Values], 'LossByCodeTargets'[Loss By Code], _code),
"Red",
"Green"
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @HDD328
For your question, here is the method I provided:
Here's some dummy data
“LossByCodeActual”
“LossByCodeTargets”
Create a measure.
OilLightsFormatting =
var _code = SELECTEDVALUE('LossByCodeActual'[Loss By Code])
RETURN
IF(
SUM('LossByCodeActual'[Values]) >
LOOKUPVALUE('LossByCodeTargets'[Values], 'LossByCodeTargets'[Loss By Code], _code),
"Red",
"Green"
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
please share the dummy data and sample output images
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 46 | |
| 30 | |
| 24 | |
| 23 |
| User | Count |
|---|---|
| 145 | |
| 111 | |
| 64 | |
| 38 | |
| 32 |