Forum Discussion
conditional Formatting in Calculation Item
- 7 months ago
Thankyou, MFelix, burakkaragoz and cengizhanarslan for your responses.
Hi Mniknejad,Thank you for the update.
Based on my understanding, when multiple calculation groups are placed on Matrix columns in Power BI, the calculation item context is not preserved during visual rendering. Conditional formatting is evaluated after the DAX query completes, by which time the identity of specific calculation items is no longer reliably available. Consequently, visual level conditional formatting cannot consistently determine which calculation item produced a given value, and therefore may be unreliable in this scenario.
Please consider the following workarounds, which may help resolve the issue:
- Move scenario logic out of calculation groups on columns. Instead, use explicit measures or a Scenario dimension. Limit to at most one calculation group affecting columns. This preserves formatting context and ensures reliable behavior.
- Split the matrix into separate visuals. One for base values and another for variance values that require conditional formatting. This approach avoids loss of calculation group context at render time.
If you require calc-item-scoped conditional formatting across multiple calculation groups, please raise an idea on the Ideas forum using the link:Fabric Ideas - Microsoft Fabric Community
We hope this information helps resolve the issue. If you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Hi, this is expected behavior when using calculation groups.
When a calculation group with dynamic format strings is applied, the value rendered in the matrix is no longer exposed as a pure numeric value to the visual. That’s why ISNUMBER() returns FALSE and why standard conditional formatting rules become unreliable for specific calculation items like LE % Var and LY % Var. This is a known limitation, not a bug.
Power BI does not support per-calculation-item conditional formatting directly in a matrix.
Supported pattern
The only reliable approach is to separate value logic from formatting logic:
Keep the visible KPI measure purely numeric (no formatting logic).
Use dynamic format strings in the Scenario calculation group to handle:
Percent formatting
Parentheses for negative values
Drive font color using a separate color measure and apply conditional formatting using Field value.
Example:
KPI Color := VAR Scenario = SELECTEDVALUE ( 'Scenario'[Scenario] ) VAR Value = [KPI_Value_Visible_CAD] RETURN IF ( Scenario IN { "LE % Var", "LY % Var" } && Value < 0, "#C00000", "#000000" )Then apply Font color → Conditional formatting → Field value based on this measure.
This pattern:
Works reliably with calculation groups
Preserves correct totals
Is fully supported
Per–calculation-item conditional formatting is currently not supported in Power BI matrices.