Forum Discussion
Disable button based on button text
Hi,
I'm trying to disable a button when Button Text displays "View Restricted".
Right now, my button text is formulated so it displays either "view restricted" or "click to view report" based on their userprincipalname. So for example, if user A is eligible to view, when user A sees the welcome page, he will see "Click to View Report"; if user B's not eligible, then user B sees "View Restricted."
I want the button to navigate me to another tab (named Home) when it says "Click to View Report" but when it says "View Restricted" I want the button to be disabled.
Is this possible?
5 Replies
- AllisonKennedyCommunity ChampionYou could try this using a workaround similar to this method described here, by using the 'drilllthrough' functionality for your button rather than 'page navigation' and adding a visual that the user has to click to enable the button. Choose or configure the data so that only non-restricted users see the visual that needs selected before they can navigate:
https://www.linkedin.com/pulse/adding-password-box-power-bi-report-wyn-hopkins/- AnonymousNot applicable
I am trying to avoid drillthrough function because there is nothing to be selected to trigger the drillthrough. The report is pulling who is viewing the report by userprincipalname function, which then changes the button text to either restricted or click to view data.
Is there not a way to reach a solution by keeping navigation button (and making the button have multiple functions depending on button text) instead of changing it to drillthorugh?
- AllisonKennedyCommunity ChampionNot yet, you could vote for it on ideas.powerbi.com
- AnonymousNot applicable
I know this is rather late, but you can do the disabling without needing to do the drill-down functionality.
1. Create a measure with a conditional check -Destination_Page = IF(ISFILTERED('Table'[Location]),"Page 2")2. On a standard button, choose Page Navigation as the type3. In the Destination field, use the measure.You can do the same thing on the button text, obviously with a different measure.In the action feature of a standard button, choose Page Navigation.