add_view_switcher
Adds a button bar to a Power BI page to switch between views, showing only the visuals assigned to each view while hiding others. Builds display-only bookmarks and sets the initial view.
Instructions
THE premium pattern from pro reports: one page, a button bar that swaps between VIEWS - each view shows its own visuals and hides the rest. Builds the Display-only bookmarks + the buttons + sets the initial state to the first view. views = JSON array of {name, visuals:[visualName,...]} (visual names from list_visuals/add_* results). Ground-truthed from a real report.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"reportSessionId": "<reportSessionId>",
"pageName": "<pageName>",
"views": "<views>"
},
"name": "add_view_switcher"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| gap | No | ||
| views | Yes | JSON array of {name, visuals:[visualName,...]} | |
| pageName | Yes | ||
| fillColor | No | inactive button fill | #5B7494 |
| textColor | No | button text colour | #FFFFFF |
| buttonWidth | No | ||
| buttonHeight | No | ||
| activeFillColor | No | active (first) button fill | #16365C |
| reportSessionId | Yes |