Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I'm using the Stacked Bar Chart to display the grading of my field audits and want to apply color conditional formating but I am needing a measure. I've tried the below DAX but it won't reference the correct data of "Score" within the 2026 New Detail Table. I've changed the [Avg Score] to just [Score] but that is not working and the error I receive is, "The value for 'Score' cannot be determined. Either the column doesn't exist, or there is no current row for this column." I added screenshots below if someone can help me with this measure and visual.
Bar Color =
SWITCH(
TRUE(),
[Avg Score] <= 2, "#D32F2F", -- Red (Needs Improvement)
[Avg Score] = 3, "#FBC02D", -- Yellow (Meets Expectations)
"#388E3C" -- Green (Exceeds Expectations)
)
Solved! Go to Solution.
For a bar chart that’s using “Average of Score”, define it explicitly:
Avg Score =
AVERAGE ( '2026 New Detail Table'[Score] )
2) Use that measure in your color measure
Bar Color =
VAR s = [Avg Score]
RETURN
SWITCH (
TRUE(),
s <= 2, "#D32F2F", -- red
s = 3, "#FBC02D", -- yellow
"#388E3C" -- green
)
In the stacked bar chart:
Format → Data colors
Click fx
Format by: Field value
Based on field: Bar Color
Hi @PPars2025 ,
I would also take a moment to thank @cengizhanarslan , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions
For a bar chart that’s using “Average of Score”, define it explicitly:
Avg Score =
AVERAGE ( '2026 New Detail Table'[Score] )
2) Use that measure in your color measure
Bar Color =
VAR s = [Avg Score]
RETURN
SWITCH (
TRUE(),
s <= 2, "#D32F2F", -- red
s = 3, "#FBC02D", -- yellow
"#388E3C" -- green
)
In the stacked bar chart:
Format → Data colors
Click fx
Format by: Field value
Based on field: Bar Color
Thank you! Can you explain where to findthe following? I am not seeing data colors within the forman pane options:
Format → Data colors
Hi @PPars2025 ,
Try to create (or use) a measure that aggregates Score, then use it for conditional formatting.
Avg Score =
AVERAGE ( '2026 New Detail Table'[Score] )
Use this measure for bar color
Bar Color =
SWITCH (
TRUE(),
[Avg Score] <= 2, "#D32F2F", -- Red (Needs Improvement)
[Avg Score] = 3, "#FBC02D", -- Yellow (Meets Expectations)
"#388E3C" -- Green (Exceeds Expectations)
)
If this response was helpful, please accept it as a solution and give kudos to support other community members
Regards,
Rufyda Rahma | MIE
I am not sure I am following. Are you saying to use two measures?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |