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
DebbieE
Community Champion
Community Champion

Date Slicer seems to remove the report filter Flag for last 3 years

I have a measure for rolling 3 year flag

 

Rolling 3 Year Flag = IF(DATEDIFF('Date'[Date].[Date],TODAY(),YEAR)<=3 && DATEDIFF('Date'[Date].[Date],TODAY(),YEAR)>=0,1,0)
 
this flag has been added to the entire report and set to 1 to make sure I only have information from these 3 years
 
If I add date as a table I get 2017 2018 2019 and 2019 as expected for a rolling flag.
 
However As soon as I change that table into a Slicer, all the years appear in the data set. right from 2000.
 
I dont understand why the filter stops being applied on the slicer
 
I have tried adding the filter on the Slicer visual but that doesnt make any difference either
 
How come its fine if the date is in a table but then the slicer shows all the dates?
 
1 ACCEPTED SOLUTION

All resolved

 

I hadnt marked my date table as a date table

 

I wasnt sure why I needed to do this, since you lose all the hierarchies under your dates

 

However I have now moved to a marked date table and now my Date Slicer works properly. You can apply a flag to it like current year and it all works because all the items in the date table are now viewed as Date information

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@DebbieE , do use .date, unless you have timestamp

use only 'Date'[Date]  in place of 'Date'[Date].[Date]

 

Also you can restrict 3 years using relative date filter at page or report level

 

my filter contains Year and Month from the date hierachy

I add Date and relative date last 3 years as a filter in the slicer and it still doesnt work

Hi @DebbieE ,

 

Does your data contain sensitive information? If you don’t mind, please share your .PBIX file.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Unfortuntely I cant share the pbix file. 

 

I have a fact table and a date table

 

When I have the date in a table it will filter no problems, with either a flag or relative filter

As soon as I change it to a slicer (Year and month hierarchy) the filters dont work any more

 

Ive noticed it throughout using Power BI and its becoming a real issue

Hi @DebbieE ,

 

"As soon as I change it to a slicer (Year and month hierarchy) the filters dont work any more..."

Could you show us this problem with screenshots or animations?

 

I thought your visual effect was like this.

ccc15.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

All resolved

 

I hadnt marked my date table as a date table

 

I wasnt sure why I needed to do this, since you lose all the hierarchies under your dates

 

However I have now moved to a marked date table and now my Date Slicer works properly. You can apply a flag to it like current year and it all works because all the items in the date table are now viewed as Date information

parry2k
Super User
Super User

@DebbieE you have to use it as a visual level filter on the slicer, also you should add it is a column and then put it page level filter so all the visuals are filtered on this flag.

 

As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

DebbieE
Community Champion
Community Champion

you have to use it as a visual level filter on the slicer, also you should add it is a column and then put it page level filter so all the visuals are filtered on this flag.

 

I am using a date dimension as per the standard design recommendations

 

I did put the filter on the slicer and it made no difference

 

Im not understanding the second part of your response "also you should add it is a column and then put it page level filter so all the visuals are filtered on this flag"

 

 

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.