Forum Discussion

Bhavyasree24's avatar
Bhavyasree24
Icon for Helper I rankHelper I
1 year ago
Solved

How to hide an Info Button when visual has no data

  Hi everyone, I'm working on a Power BI report where we've added an Info button next to a visual to display a description when clicked. However, if the visual has no data (e.g., shows "No data re...
  • bhanu_gautam's avatar
    bhanu_gautam
    1 year ago

    Bhavyasree24 To conditionally hide or disable the Info button based on whether the associated visual has data or not, you can use a workaround since Power BI does not support conditional formatting for button transparency directly.

     

    Create a measure that returns a value based on whether the visual has data or not. For example:

    HasData = IF(COUNTROWS('YourTable') > 0, 1, 0)

     

    Since conditional formatting for transparency is not supported on buttons, you can use a shape (like a rectangle) and place it over the button. Then, apply the transparency logic to the shape.

     

    Select the shape.
    Go to the "Format" pane.
    Under "Shape", find the "Fill" option.
    Use the measure HasData to set the transparency. If HasData is 1, set transparency to 0% (fully visible). If HasData is 0, set transparency to 100% (fully hidden).