Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
yerketai
New Member

Conditional Formatting on Y-Axis Not Responding to Slicer Selection

Hello Microsoft Support Team,
I'm trying to apply conditional formatting to the Y-axis labels of a clustered bar chart in Power BI using a DAX measure like this:
ColorMeasure =
VAR _selected = SELECTEDVALUE('ParameterTable'[Parameter])
RETURN
IF(
SELECTEDVALUE('MainTable'[Category]) = _selected,
"#505050",
"#FFFFFF"
)
The chart uses MainTable[Category] on the Y-axis. A slicer uses ParameterTable[Parameter]. These tables are not related because I want all categories visible, but only the selected one to appear gray.
The issue is that the measure doesn't respond to slicer selection. It seems Power BI needs a relationship for the slicer to influence the measure, even though I only want to reference the selected value.
Can conditional formatting of axis labels respond to slicers without relationships? If not, is there a workaround like TREATAS? Is this a known limitation or by design?
Thanks for your help.

2 REPLIES 2
FarhanJeelani
Super User
Super User

Hi @yerketai ,
No, axis label formatting won’t respond to a slicer from a disconnected table. DAX in conditional formatting uses the visual’s filter context, which isn’t activated without a relationship.


Workarounds:
Add a bridge table that links ParameterTable[Parameter] to MainTable category keys, then use TREATAS/RELATE to push the slicer filter to the axis context.

Create a measure that propagates the selected parameter via that bridge so the axis colors update.


In short: either create a bridge table (or proper relationship) or use TREATAS to propagate the slicer filter; this is a known limitation of axis formatting without relationships.

 

A compact example skeleton (adjust to your schema):

Bridge table:

ParameterCategoryBridge(Parameter, CategoryKey)

Relationships:

ParameterTable[Parameter] 1..* to ParameterCategoryBridge[Parameter] (or many-to-one as appropriate)
ParameterCategoryBridge[CategoryKey] 1..1 to MainTable[CategoryKey]


Measure:

ColorMeasure = VAR _selected = SELECTEDVALUE( ParameterTable[Parameter] ) VAR _isGray = CALCULATE( IF( ISBLANK(_selected), 0, 1 ), TREATAS( VALUES( ParameterTable[Parameter] ), ParameterCategoryBridge[Parameter] ), TREATAS( VALUES( MainTable[CategoryKey] ), ParameterCategoryBridge[CategoryKey] ) ) RETURN IF( _isGray = 1, "#505050", "#FFFFFF" )

 

Please mark this post as solution if it helps you. Appreciate Kudos.

 

 

thank you but both approaches did not work
could you please recheck and send me the testing dashboard with working logic

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors