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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Filter month year column to exclude past dates from slicer

I have a dates key table that runs from Jan 2018 - Jan 2021.

 

I have a month year column (Text Format) so it doesn't display data past today:

On or Before Today = 'DimDate'[DateS] <= EOMONTH(TODAY(),0)
 
Is there a way to have a slicer's past dates respected when it changes?
e.g. When I slice the last 24 months I get this
 
Filter date.PNG
 
However when I slice the last 2 months I still get the begining dates of slicer:Filter date1.PNG
 
Something along the lines of this???
On or Before Today = ALLSELECTED('DimDate Sort'[Dates]) >= 'DimDate'[DateS] <= EOMONTH(TODAY(),0)

 

Thanks in advance
 
*CAVEAT - I have a DimDate table for counts and a DimDate Sort to build relationships off in case you're wondering
4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Following this video, if you want to select date/month and then have rolling month.

https://www.youtube.com/watch?v=duMSovyosXE

 

You can also refer this for List of value

https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-30/m-p/1284966#M561629

Fowmy
Super User
Super User

@Anonymous 

Relative Date slicer always takes the current date to calculate the dates, that cannot be changed.

What is your expected output when you select a range?

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  I'm hoping to get an expected output like this if I cast the slicer date range at last 2 months:Filter date2.PNG

@Anonymous 

I am not sure how you have set up your model and the relationships. Also, The measure you are using can be another point to check. If you could share a sample PBIX file, it's possible to identify the cause.

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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