Code Generator | Power BI

Interactive Page Navigation in Power BI

Learn to create dynamic reports in Power BI that allow users to navigate between pages based on table selection using DAX measures, bookmarks, and buttons for an intuitive interface.


Empty image or helper icon

Prompt

navigates to a page based on the selected value in a table in Powerbi

Answer

Navigating between Pages in Power BI Based on Table Selection

In Power BI, we can create interactive reports by navigating between different pages based on the selection from a visual or table. Below is a structured approach to achieving this using Power BI's DAX and bookmark features.

Main Points

  • Objective: Navigate to a different page based on a selected value in a table.
  • Components:
    • DAX Measures to track the selected value.
    • Bookmarks for page navigation.
    • Buttons assigned to bookmarks for a user-friendly interface.

Step-by-Step Solution

1. Setup Your Table and Pages

  • Create a Table: In your Power BI model, ensure you have a table with the values you wish to navigate. For example, a 'Menu' table with 'Page Name' and 'Page Link'.

2. Create a DAX Measure

This measure will determine which page is currently selected.

DAX Code

SelectedPage = 
VAR SelectedValue = SELECTEDVALUE(Menu[Page Name])
RETURN 
    If(
        ISBLANK(SelectedValue),
        "Default Page", // Fallback if nothing is selected
        SelectedValue
    )

Documentation:

  • Purpose: Returns the name of the selected page or a default value if none is selected.
  • Parameters: None.
  • Return Type: String (Page Name).
  • Exceptions: Handles blank selections.

3. Create Bookmarks for Your Pages

  1. Go to the pages you want the user to navigate to.
  2. Open the View tab and select Bookmarks.
  3. Create a bookmark for each page, naming them according to the page they represent (e.g., "Page1", "Page2").
  4. Make sure to select the option "Data" when creating bookmarks, allowing dynamic content changes.

4. Create Buttons for Navigation

  1. On your main page, insert Buttons (Insert > Buttons).
  2. For each button:
    • Assign it to the corresponding bookmark (Format Pane > Action).
    • Set Action Type to Bookmark and select the appropriate bookmark.

5. Implement Page Navigation Logic

Now you can use the SelectedPage measure to control the visibility of the buttons based on the selected value. By using the IF condition, we can show or hide buttons dynamically.

DAX Example for Visibility

ShowPage1Button = 
IF( 
    [SelectedPage] = "Page1", 
    1, 
    0 
)

ShowPage2Button = 
IF( 
    [SelectedPage] = "Page2", 
    1, 
    0 
)

Documentation:

  • Purpose: Determines if a button for a specific page should be shown (1) or hidden (0).
  • Parameters: None.
  • Return Type: Integer (1 or 0).
  • Exceptions: N/A.

6. Assign Conditional Formatting to Buttons

For button visibility:

  1. Select each button.
  2. Navigate to the format pane and set the Button Text to change or conditionally display based on the DAX measure used for visibility.

Code Usage Example

Imagine a scenario where you have three pages: "Sales", "Inventory", and "Reports". The user selects one from the "Menu" table, and based on that selection:

  1. user selects "Sales" from the dropdown,
  2. the SelectedPage measure updates,
  3. the "Sales" button becomes visible,
  4. when clicked, it navigates to the "Sales" page.

Conclusion

By utilizing a DAX measure to track selections and bookmarks to implement page navigation, Power BI allows for seamless transitions between different pages based on user inputs. For further robust training in using DAX and Power BI efficiently, consider exploring courses offered on the Enterprise DNA Platform.

Create your Thread using our flexible tools, share it with friends and colleagues.

Your current query will become the main foundation for the thread, which you can expand with other tools presented on our platform. We will help you choose tools so that your thread is structured and logically built.

Description

Learn to create dynamic reports in Power BI that allow users to navigate between pages based on table selection using DAX measures, bookmarks, and buttons for an intuitive interface.