Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dougeefresh
New Member

Multiple synced date slicers for a single graph

Hello,

 

I would like to add multiple date slicers to a page that has one bar graph and have them control the graph independently.

Basically, two groups of control: One doing previous xx days filtering (either pulldown or radio buttons) and the other doing a typical begin/end slider. Two groups will be synced so if one group changes, the other slicer would change to reflect it. If the date slider (bottom one) is set at something that's not available in the past xx days control, the past xx days control will be unselected. Here is a mockup to add clarity. Thanks!

 

sample.jpg

 

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi @dougeefresh  ,


According to your description, you could create a table as slicers, then create a flag measure and apply it into filter. the following formula to create :
Step1: Enter slicer table

v-yalanwu-msft_3-1620265444696.png

Step2: Create a flag measure

flag =
VAR _diff =
DATEDIFF ( MAX ( 'table'[Date] ), TODAY (), DAY )
RETURN
IF(ISFILTERED(slicer[Slicer]),SWITCH (
SELECTEDVALUE ( 'slicer'[Slicer] ),
"Past 7 days",
IF ( _diff <= 7 && _diff >= 0, 1 ),
"Past 30 days",
IF ( _diff <= 30 && _diff >= 0, 1 ),
"Past 60 days",
IF ( _diff <= 60 && _diff >= 0, 1 )
),1
)

Step3: Apply the flag measure into filter

v-yalanwu-msft_4-1620265451635.png

The final output is shown below:

v-yalanwu-msft_5-1620265455816.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@dougeefresh , As far as my experiments in the past, I doubt you can control range filter-based another slicer like this.

 

But create a measure like this and use as a visual level filter as not blank

measure =
Switch(true() ,
selectedvalue(slicer[slicer]) = "Last 7 days" , if(max(Date[Date]) >=Today() -7 && max(Date[Date])<=today(),1, blank())
// add others,
blank()
)

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.