Forum Discussion

viswaaa's avatar
viswaaa
Icon for Helper IV rankHelper IV
1 year ago
Solved

Show/Hide Textbox based on button

Hi All,   I have a requirement where I need to show/hide my textbox based on clicking the info button. If the user clicks on info button I need to show textbox which has a note in it. And then ag...
  • MohamedFowzan1's avatar
    1 year ago
    • Bookmark 1: Text box is hidden.

    • Bookmark 2: Text box is visible.

    ➤ Bookmark 1 (Textbox Hidden)

    1. Hide the textbox (NoteTextBox):

      • Click the textbox → press eye icon in the Selection pane to hide it.

      • Or go to ViewSelection Pane, and hide it from there.

    2. Go to ViewBookmarks Pane.

    3. Click Add → Rename it to HideNote.

    4. Click the next to the bookmark → Check only:

      • Data: OFF

      • Display: ON

      • Current Page: ON

      • All Visuals: ON

         

    ➤ Bookmark 2 (Textbox Visible)

    1. Show the textbox by clicking the eye icon again in the Selection Pane.

    2. In the Bookmarks Pane:

      • Click Add → Rename it to ShowNote.

      • Same settings as above: Only Display, Current Page, and All Visuals checked.


    Step 4: Add Bookmark Actions to the Info Button

    Since a Power BI button can only be assigned one action at a time, we will use a workaround with two overlapping buttons.

    ➤ Create Two Info Buttons

    1. Duplicate the InfoButton. Now you have:

      • InfoButton_Show → will show the textbox

      • InfoButton_Hide → will hide the textbox

    2. Assign actions:

      • InfoButton_Show → set Action = BookmarkShowNote

      • InfoButton_Hide → set Action = BookmarkHideNote

         

         

    ➤ Set Visibility of Buttons Using Bookmarks

    • In HideNote:

      • Show InfoButton_Show

      • Hide InfoButton_Hide

      • Hide NoteTextBox

    • In ShowNote:

      • Show InfoButton_Hide

      • Hide InfoButton_Show

      • Show NoteTextBox

    This creates a toggle effect: clicking InfoButton_Show reveals the text and switches to InfoButton_Hide, and clicking that hides it again.

     

    Reference:



    Use the name and content you desire based on the requirement.

     

    If resolved, Mark as Solution to guide others!