The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 returned"), we want to hide the Info button dynamically.
Is there a way to conditionally hide or disable the Info button based on whether the associated visual has data or not?
Any suggestions or workaround would be greatly appreciated!
Thanks in advance.
Solved! Go to Solution.
@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).
Proud to be a Super User! |
|
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.
Hi @Bhavyasree24 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
@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.
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.
@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).
Proud to be a Super User! |
|
@Bhavyasree24 Create a measure that returns a value based on whether the visual has data or not. For example, you can create a measure that counts the rows in your dataset.
HasData = IF(COUNTROWS('YourTable') > 0, 1, 0)
Select the button.
Go to the "Format" pane.
Under "Button Text", find the "Conditional Formatting" option for "Fill".
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).
Proud to be a Super User! |
|