Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

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 5
Anonymous
Not 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 type
3. 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. 

AllisonKennedy
Super User
Super User

You 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/

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not 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? 

Not yet, you could vote for it on ideas.powerbi.com

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hmm. Then is there a way to use drillthrough without having to make any selection? I need users to be able to see the whole page as long as they have the credential to (from the front page usernameprincipal function to read who is viewing it). The website you gave me earlier needs users to put in username and password, but I want to make this as simple as possible. Thank you for that solution though, I will definitely use it if drillthrough without selection doesn't work! 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.