Forum Discussion
How to hide an Info Button when visual has no data
- 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).
bhanu_gautam Thanks for the reply,I implemented the dynamic transparency logic by creating the measure, and it works as expected for shapes. However, it doesn’t seem to apply to buttons, as conditional formatting for transparency is not supported on buttons.
- v-menakakota1 year ago
Community Support
Hi Bhavyasree24 ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- Bhavyasree241 year ago
Helper I
Hi v-menakakota Still my query is open.
- bhanu_gautam1 year ago
Super User
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).