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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Campslol
Frequent Visitor

Date Selector interaction with Date Slicer

Hi folks,

 

I'm struggling to get a "Between" Date Slicer to adjust its range to the start date I'm setting using a Date selector. Here are the details:

 

I have a date selector which is using a switch and a measure to filter out dates before the selected start date on all of my visuals:

 

2020-03-07_0-19-35.jpg           2020-03-07_0-21-47.jpg

 

 

Date Range = IF([Start Date]>=MAX('Calendar'[Calendar Date]),1,0)

 

 

This is working as intended but my users are requesting a timeline date slicer in addition to the Start date selector:

 

2020-03-07_0-35-30.jpg

 

This is also working except for the fact that the lower bounds isn't being set by the Start date selected in the Date Range Selector.

 

Any Ideas on how to get this to work? Also I'm curious if there would there be a better way to filter the date range of my visuals using a dynamic start date selector. Having to use a measure as a flag in the visual filter of each idividual visual seems shody. Any help is incredibly appreciated, you're all amazing people 🙂

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Campslol ,

 

Create a measure as below and make the slicer filtered by it. After that we should edit the interaction of the two slicers to make it work.

Measure = IF( MAX('Calendar'[Calendar Date])>= [Start Date],1,0)

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

8 REPLIES 8
v-frfei-msft
Community Support
Community Support

Hi @Campslol ,

 

Create a measure as below and make the slicer filtered by it. After that we should edit the interaction of the two slicers to make it work.

Measure = IF( MAX('Calendar'[Calendar Date])>= [Start Date],1,0)

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thanks @v-frfei-msft!

 

That solution is perfect but it's not available on my version of Desktop 😞

 

I'll just wait until I get the update. Thanks for everyone's input.

 

 

Anonymous
Not applicable

Hi @Campslol 

If I resolve your problem Mark it as a solution so that it will help others.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar


Campslol
Frequent Visitor

Hi @Greg_Deckler  & @amitchandak,

 

Thanks for your replies! Unfortunately I can't share the original .pbix but I've created a sample file.

 

The main issue is that my Start date filter doesn't limit the Calendar Date timelime filter:

 

2020-03-08_0-30-44.jpg

 

I'm open to different ways of setting up the date filtering if you have any suggestions!

 

Cheers,

@Campslol 

I created a formula like this and added it to the table.

 

Measure = CALCULATE(COUNT('Contract Header'[Contract #]),USERELATIONSHIP('Calendar'[Calendar Date],'Contract Header'[Start Date]),CROSSFILTER('Calendar'[Calendar Date],Sales[Date],None))

 

 

File attached at after signature

Anonymous
Not applicable

So you want last 6 or 12 months of data from selected end date.

Create one date dimension which is not connected with your main table.

Create one slicer table for 6 months 12 months values in it.

Then create measure using switch statement and add condition for actual date column.

Switch(true(),selectevalue(slicer[col])="last 6 month" && (max(table[date]) <= today() && max(table[date])>= dateadd(max(date[date]),-6,month),1,0)

May be syntax is not correct but i have given you fair idea about solution.

Thanks
Pravin



Greg_Deckler
Super User
Super User

Hmm, this looks like an interesting issue although off of the top of my head I an not sure there is a solution. Can you post your PBIX or sample/example data. I think it would be interesting to look at.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

When you select 12 months, it selects the correct end date, not the start date. Can you explain with example

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.