Forum Discussion
Conditional Formatting on Y-Axis Not Responding to Slicer Selection
- 10 months ago
Hi yerketai,
Thank you for reaching out to Microsoft Fabric Community.
Thank you FarhanJeelani for the prompt response.
Power BI currently does not support per tick conditional formatting of axis labels. Axis conditional formatting evaluates as a single value for the visual, so you can set one dynamic color for the whole axis but cannot color individual Y-axis labels based on slicer selection.
The best approach is to color the bars or data labels instead of the axis labels, this evaluates per category and will respond to your disconnected slicer.
Thanks and regards,
Anjan Kumar Chippa
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