Forum Discussion
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!
- Anonymous1 year ago
Hi, Anonymous
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")When I don't have a slicer selected, I can't do the jump:
When I select the slicer, it jumps successfully:
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.
4 Replies
- rajendraongole1Super User
Hi Anonymous - 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.
- AnonymousNot applicable
I do not have the formula button in the actionfield...
- AnonymousNot applicable
Hi, Anonymous
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")When I don't have a slicer selected, I can't do the jump:
When I select the slicer, it jumps successfully:
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.
- Kedar_PandeSuper User
Anonymous
- Create a Measure to Check Selection:
IsRouteSelected =
IF(
ISFILTERED(YourTable[Route]),
1,
0
) - 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). - 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 - Create a Measure to Check Selection: