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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
bnjmnnl
Helper I
Helper I

Button output based on condition

Hello all!

Is the following possible, and if so, is someone able to help me?:

I'm building a page where users can see all summarized costs per route. However these costs are based on multiple costlines, such as transport, admin, fuel etc. Next to the table I have placed an 'Information button' wich leads to a bookmark showing a pop-up containing a table with all these costlines regarding the selected route. As you may understand, I do not want the user be able to press te button if there is no route selected. 
Currently, I formatted the color of the button to be the same color as the background so it is not visible. However, when the mouse is hovering it's still clickable. Preferred is that this button is only clickable when a route is selected. Is this possible?

If more info needed, please ask me!

Thank you in advance!

1 ACCEPTED SOLUTION

Hi, @bnjmnnl 

Indeed, you are right! When using the bookmark type, you cannot apply fx expressions. Setting the button as page navigation and combining it with a measure is indeed an effective solution. In this way, when the user selects the slicer, the page jump can be achieved.

Measure = IF(HASONEFILTER(TestSlicer[Values]),"Page 2")

vjianpengmsft_0-1731898589686.png

When I don't have a slicer selected, I can't do the jump:

vjianpengmsft_1-1731898634641.png

When I select the slicer, it jumps successfully:

vjianpengmsft_2-1731898666206.png

vjianpengmsft_3-1731898680091.png

 

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
Kedar_Pande
Super User
Super User

@bnjmnnl 

  1. Create a Measure to Check Selection:
    IsRouteSelected = 

    IF(

    ISFILTERED(YourTable[Route]),

    1,

    0

    )
  2. Select the button on your page.
    Go to the Format Button pane.
    Under the Action section, turn on the action toggle.
    Set the Action type to Bookmark (your pop-up bookmark).
  3. In the same Action settings, click on the small fx (conditional formatting) icon next to Action.
    Use the IsRouteSelected measure:
    Set Field Value as the format type.
    Select your IsRouteSelected measure.
    The button will now only work when IsRouteSelected = 1.

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

rajendraongole1
Super User
Super User

Hi @bnjmnnl - Instead of creating two separate buttons, you can apply conditional formatting to the button’s Action settings. Go to the button’s Action properties, set Action to On, and select a conditional formatting rule that links it to the RouteSelected measure. If RouteSelected equals 1, the action can be linked to the bookmark, but if it equals 0, it will not perform any action.

 

This approach requires careful configuration, but it will prevent users from clicking the button when it is irrelevant.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





bnjmnnl_0-1731670286067.png

I do not have the formula button in the actionfield...

 

Hi, @bnjmnnl 

Indeed, you are right! When using the bookmark type, you cannot apply fx expressions. Setting the button as page navigation and combining it with a measure is indeed an effective solution. In this way, when the user selects the slicer, the page jump can be achieved.

Measure = IF(HASONEFILTER(TestSlicer[Values]),"Page 2")

vjianpengmsft_0-1731898589686.png

When I don't have a slicer selected, I can't do the jump:

vjianpengmsft_1-1731898634641.png

When I select the slicer, it jumps successfully:

vjianpengmsft_2-1731898666206.png

vjianpengmsft_3-1731898680091.png

 

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.