Forum Discussion
remove button colour fill function
- 1 year ago
Hi DEngg,
Thanks for using Microsoft Fabric Community Forum.
Even though you're using a column for the button values (such as Online, Offline, and Unknown) and not a measure, the issue with conditional fill colour still occurs because Power BI buttons, especially in the Power BI Service (Fabric) -- do not always retain the proper evaluation context needed for conditional formatting. This means that even if the data comes from a column, the button may not be able to determine which specific value is selected when the report loads or when multiple selections are made. As a result, the fill colour condition either doesn’t apply or defaults to blank. Since you're using multi-selection buttons to filter visuals based on machine status, replacing them with shapes is not ideal due to the lack of interactivity and added complexity with bookmarks. A more reliable approach would be to base the button design on a fixed reference table that includes both the status values and their associated colours. This helps maintain context and ensures that the fill colours work consistently across both Desktop and the Service. Until Microsoft resolves this inconsistency in the Service, this workaround offers the best balance between functionality and appearance.
I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.Best regards,
Sahasra.
Hi DEngg ,
This issue typically happens because conditional formatting on a button’s fill color in Power BI Desktop doesn't always translate properly when published to the Power BI Service (Fabric). The Service often fails to evaluate DAX-based color expressions if the measure you're using doesn't have the right context or returns blank. For example, if your fill color is defined like this:
ButtonColor = IF([Status] = "Active", "#0078D4", "#A80000")
it may work in Desktop where filters and visual context are applied, but fail silently in the Service where the button lacks context. This results in the fill color disappearing or defaulting.
To debug, try wrapping the logic in a COALESCE to force a default color:
ButtonColor = COALESCE(
IF([Status] = "Active", "#0078D4", "#A80000"),
"#FFFFFF"
)
If that doesn’t work, replace the button with a shape, which handles conditional formatting more reliably, or test the measure by applying it to a card to confirm it returns a value. The Service can be finicky about visuals like buttons that aren’t tied to a data context, so moving to a shape or card visual with an assigned action often bypasses the issue until Microsoft fixes the bug.
Best regards,
this problem also occurs within fabric report to edit and save.
We can not use shape because we need to use multiple selection buttons
If we used a shape based on all statuses, we need to use a different page or bookmark