Forum Discussion
How to Keep Global Slicer While Using a Local Override on Subpages?
oh okay i get it now , like amitchandak said I also doubt that you can stop bidirectional sync slicer & skip bookmarks to achive what you need , however my workaround suggestion is to do with a global & local picker slicer
1.first create a slicer table
SlicerSelector =
DATATABLE(
"Option", STRING,
{
{"Global"},
{"Gross Sales Analysis - Sub Page"}
}
)
2. create two months tables for both pages
3. create an inactive relationship between these two tables
4. create measures for each calculation you need ,(i have only created three in this example)
5. create these switch measure for each measure to pick which slicer
Total Gross Sales Switch =
VAR SelectedOption =
SELECTEDVALUE(SlicerSelector[Option], "Use Slicer 1")
RETURN
SWITCH(
SelectedOption,
"Global",
CALCULATE(
[Sum Gross Sales],
USERELATIONSHIP(financials[Month Name], 'Global'[Month Name])
),
"Gross Sales Analysis - Sub Page",
CALCULATE(
[Sum Gross Sales],
USERELATIONSHIP(financials[Month Name],'Gross Sales Analysis - Sub Page'[Month Name])
)
)
6. and now apply these measure to each visual
7. use slicer table option column as a single select slicer , now once you pick global or local it will pick that specific slicer
I have attached the sample i have created for your reference
Thank you very much.
Hmm could i check if I am on specific sub page and pass the value to this slicer?
Best,
Jacek
- v-echaithra9 months ago
Community Support
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. - 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. - jaryszek9 months ago
Super User
Thank you,
can you please share any example how this can work?
Best,
Jacek