Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have period individual slicer button as below like 4W , 8W , 13W , 26W , 52W .. The ask is , these slicer buttons should be dynamic. .i.e Eg : If the forecast data is sent only for 13 weeks only 4, 8, 13 weeks should be shown ..it should not show 26W and 52W slicer buttons since we don't have the data . same as If the forecast data is sent only for 26 weeks only 4, 8, 13, 26 weeks should be shown , shoud not show 52W slicer button How can we achive this ? any help please?
i have week slicer as below and
Solved! Go to Solution.
@Anonymous , Try using below method
Create a Table for Slicer Options: Create a table that contains all possible slicer options (e.g., 4W, 8W, 13W, 26W, 52W). This table will be used to dynamically filter the slicer options based on the available forecast data.
SlicerOptions
-------------
Period
4W
8W
13W
26W
52W
Create a Measure to Determine Available Periods
MaxPeriod =
VAR MaxWeeks = MAX('ForecastData'[Weeks])
RETURN
SWITCH(
TRUE(),
MaxWeeks >= 52, "52W",
MaxWeeks >= 26, "26W",
MaxWeeks >= 13, "13W",
MaxWeeks >= 8, "8W",
MaxWeeks >= 4, "4W",
BLANK()
)
Create a Calculated Column to Filter Slicer Options:
ShowPeriod =
VAR MaxPeriod = [MaxPeriod]
RETURN
SWITCH(
TRUE(),
'SlicerOptions'[Period] = "52W" && MaxPeriod = "52W", 1,
'SlicerOptions'[Period] = "26W" && (MaxPeriod = "52W" || MaxPeriod = "26W"), 1,
'SlicerOptions'[Period] = "13W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W"), 1,
'SlicerOptions'[Period] = "8W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W" || MaxPeriod = "8W"), 1,
'SlicerOptions'[Period] = "4W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W" || MaxPeriod = "8W" || MaxPeriod = "4W"), 1,
0
)
Add a slicer visual using the SlicerOptions table. Then, apply a visual-level filter to the slicer to only show periods where ShowPeriod is 1.
Add the Period field from the SlicerOptions table to the slicer visual.
In the Filters pane, add the ShowPeriod field to the visual-level filters and set it to show only values where ShowPeriod is 1.
Proud to be a Super User! |
|
@Anonymous , Try using below method
Create a Table for Slicer Options: Create a table that contains all possible slicer options (e.g., 4W, 8W, 13W, 26W, 52W). This table will be used to dynamically filter the slicer options based on the available forecast data.
SlicerOptions
-------------
Period
4W
8W
13W
26W
52W
Create a Measure to Determine Available Periods
MaxPeriod =
VAR MaxWeeks = MAX('ForecastData'[Weeks])
RETURN
SWITCH(
TRUE(),
MaxWeeks >= 52, "52W",
MaxWeeks >= 26, "26W",
MaxWeeks >= 13, "13W",
MaxWeeks >= 8, "8W",
MaxWeeks >= 4, "4W",
BLANK()
)
Create a Calculated Column to Filter Slicer Options:
ShowPeriod =
VAR MaxPeriod = [MaxPeriod]
RETURN
SWITCH(
TRUE(),
'SlicerOptions'[Period] = "52W" && MaxPeriod = "52W", 1,
'SlicerOptions'[Period] = "26W" && (MaxPeriod = "52W" || MaxPeriod = "26W"), 1,
'SlicerOptions'[Period] = "13W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W"), 1,
'SlicerOptions'[Period] = "8W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W" || MaxPeriod = "8W"), 1,
'SlicerOptions'[Period] = "4W" && (MaxPeriod = "52W" || MaxPeriod = "26W" || MaxPeriod = "13W" || MaxPeriod = "8W" || MaxPeriod = "4W"), 1,
0
)
Add a slicer visual using the SlicerOptions table. Then, apply a visual-level filter to the slicer to only show periods where ShowPeriod is 1.
Add the Period field from the SlicerOptions table to the slicer visual.
In the Filters pane, add the ShowPeriod field to the visual-level filters and set it to show only values where ShowPeriod is 1.
Proud to be a Super User! |
|
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.