(+351) 21 24 10006  ·  info@bconcepts.pt
Carnaxide, Lisbon

How to use conditional Bookmarks in Power BI with DAX

João Barros 31 de October de 2026 4 min read

This tutorial shows how to create conditional Bookmarks in Power BI using DAX measures and buttons to control visuals and states without duplicating pages. It is useful for building interactive interfaces, reducing report duplication and avoiding synchronization issues between visuals.

Prerequisites

  • Power BI Desktop (recent version)
  • A simple data file (e.g.: sales with columns Date, Product, Sales, Region)
  • Basic knowledge of DAX, Bookmarks and Selection Pane

Step 1: Prepare the visuals that will toggle

Create the visuals you want to toggle with bookmarks. Example: a bar chart by Product and a card with a KPI. Place both on the same page and position them as desired.

Step 2: Create a control table for states

We will create a simple table in Power BI that represents the states (for example: "Visão Geral" and "Detalhe"). This table allows using slicers or measures to control conditional bookmarks.

States = DATATABLE("State", STRING, { {"Visão Geral"}, {"Detalhe"} })

Step 3: DAX measure to identify the active state

Create a measure that returns the selected state. This measure will be used in conditional bookmarks or in buttons with conditional formatting.

SelectedState =
IF(
    HASONEVALUE(States[State]),
    VALUES(States[State]),
    "Visão Geral"  -- default value
)

Step 4: Use the measure to condition visuals (visible/invisible)

For each visual you want to show/hide conditionally, use the "Visual level filters" option or the Selection Pane combined with measures. Simple method: create boolean measures that control a transparent card (overlay) or use conditional formatting on visual properties that support visibility.

Show_Barra = IF([SelectedState] = "Visão Geral", 1, 0)
Show_KPI = IF([SelectedState] = "Detalhe", 1, 0)

Practical example: apply Show_Barra as a visual filter where Show_Barra = 1 for the bar chart, and Show_KPI = 1 for the KPI card.

Step 5: Create Bookmarks reflecting the base state

Although the logic conditions visuals, it is advisable to have bookmarks that store base layout and filters. Create two bookmarks: "BM_VisaoGeral" and "BM_Detalhe". For each bookmark, set visuals and filters to the corresponding state and uncheck "Data" and "Display" if you do not want to save page selection filters.

Step 6: Create buttons and associate conditional actions

Add two buttons (or images) with the text "Visão Geral" and "Detalhe". For each button, choose the action as "Bookmark" and point to the corresponding bookmark. To make the button appearance conditional (for example background color when active), use conditional formatting based on the SelectedState measure.

IsActive_Visao = IF([SelectedState] = "Visão Geral", 1, 0)
IsActive_Detalhe = IF([SelectedState] = "Detalhe", 1, 0)

In the button formatting choose "Fill" > fx > based on the IsActive_Visao measure (colors for 1 and 0) — this gives visual feedback of the state.

Step 7: Synchronize slicer or create bookmark action to update State

If you use a slicer based on the States table, the selection changes SelectedState and the filtered visuals update automatically. If you prefer that buttons change the state without a slicer, create bookmarks that besides storing layout also save the slicer selection (check the Data option in bookmarks) to force the change of SelectedState.

Verify the result

Test the interactions: select "Visão Geral" in the slicer or click the button. The bar chart should appear and the KPI should hide; choosing "Detalhe" does the opposite. Also confirm the buttons' colors change according to the condition and that there are no page duplications for each state.

Conclusion

With this technique you combine DAX, a small control table, visual filters and Bookmarks to create conditional Bookmarks in Power BI without multiplying pages. Next steps: add animations with Selection Pane or control visibility with more complex measures (e.g.: permissions). Tip: avoid saving unwanted layout changes in bookmarks — always test with "View" turned off.