Forum Discussion
How to Keep Global Slicer While Using a Local Override on Subpages?
Hi jaryszek ,
Thank you kushanNa for your valuable inputs.
There is no DAX function that returns the current page, you can’t build a purely DAX-based page detector. But you can try this approach using Bookmarks + navigation buttons. create a “Go to Subpage” button that triggers a bookmark which both navigates and sets the slicer state you want. This effectively passes a value to slicers without user fiddling. It’s the typical workaround we can suggest.
Best regards.
Thank you,
can you please share any example how this can work?
Best,
Jacek
- v-echaithra9 months ago
Community Support
Hi jaryszek ,
Sure, you can refer this sample example file.
To achieve this behavior, use two month tables and a switching measure that chooses which slicer to respect (Global or Local).
1. Create helper tables
A) Create a Mode Selector
SlicerSelector =
DATATABLE(
"Option", STRING,
{
{"Global"},
{"Local"}
})B) Create two Month tables
GlobalMonth =
DISTINCT( 'Date'[MonthName] )LocalMonth =
DISTINCT( 'Date'[MonthName] )2. Create relationships
Active relationship
Date[MonthName] → GlobalMonth[MonthName] (Active)Inactive relationship
Date[MonthName] → LocalMonth[MonthName] (Make this one Inactive)The inactive relationship will be activated only when needed using USERELATIONSHIP.
3. Create measures
Base measure
Total Sales = SUM( Sales[SalesAmount] )Switching measure (the key logic)
Total Sales (Switch) =
VAR Mode = SELECTEDVALUE( SlicerSelector[Option], "Global" )
RETURN
SWITCH(
Mode,
"Global",
[Total Sales],
"Local",
CALCULATE(
[Total Sales],
USERELATIONSHIP(
'Date'[MonthName],
LocalMonth[MonthName]
)))
This measure decides which slicer (Global or Local) should control the visuals.4. Build the report pages
Main PageAdd slicer > GlobalMonth[MonthName]
(This is your Global slicer.)
Add slicer > SlicerSelector[Option] (optional, can be hidden)
Add visuals → use Total Sales (Switch) measureSubpage
Add slicer → LocalMonth[MonthName]
(Do NOT sync this slicer.)
Add visuals → use Total Sales (Switch) measure5. Use buttons that set Global/Local mode automatically
Since DAX cannot detect which page the user is on:
Create two bookmarks:
Bookmark A (Main Page): SlicerSelector = “Global”
Bookmark B (Subpage): SlicerSelector = “Local”Add two buttons:
On Main Page > “Go to Subpage” → triggers Bookmark B
On Subpage > “Back to Main” → triggers Bookmark AThis makes the report automatically switch between Global and Local mode during navigation.
Hope this helps.
Thank you.