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
V504942425U
New Member

Setting default date range in slicer

Hello,

 

I have placed date slicer. It is displaying default start date as 11/1/1899.

 

V504942425U_0-1660463754984.png

 

How to change default start date to 11/1/2017 & end date value to today.

 

Please help out to solve this problem.

 

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

Add a calcualted column to your date table like this.

Show = 'Date'[Date] >= DATEVALUE("11/1/2017") && 'Date'[Date] <= TODAY()

Then add that field as a filter on your slicer and set it to only show TRUE

View solution in original post

v-rzhou-msft
Community Support
Community Support

Hi @V504942425U ,

 

As far as I know, calculated column will take up memory. And Power BI doesn't support us to add a measure into slicer. I suggest you to create a measure and then add this measure into the visual level filter.

Show =
VAR _DATE =
    SELECTEDVALUE ( 'Table'[Date] )
RETURN
    IF ( AND ( _DATE >= DATE ( 2017, 11, 1 ), _DATE <= TODAY () ), 1, 0 )

Add this measure into the visual level filter of your slicer and set it to show items when value equal to 1. Result is as below.

By Default:

RicoZhou_1-1660716627140.png

Add measure into visual level filter:

RicoZhou_0-1660716611736.png

 

Best Regards,
Rico Zhou

 

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

 

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @V504942425U ,

 

As far as I know, calculated column will take up memory. And Power BI doesn't support us to add a measure into slicer. I suggest you to create a measure and then add this measure into the visual level filter.

Show =
VAR _DATE =
    SELECTEDVALUE ( 'Table'[Date] )
RETURN
    IF ( AND ( _DATE >= DATE ( 2017, 11, 1 ), _DATE <= TODAY () ), 1, 0 )

Add this measure into the visual level filter of your slicer and set it to show items when value equal to 1. Result is as below.

By Default:

RicoZhou_1-1660716627140.png

Add measure into visual level filter:

RicoZhou_0-1660716611736.png

 

Best Regards,
Rico Zhou

 

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

 

 

@v-rzhou-msft 

It is the cardinality of the data that determines the amount of memory the columns takes so a True/False column will take up very little memory in the model.  On my dates table, I have a column 'Is Past' that is a True/False and it uses 1.3 kb of memory.

jdbuchanan71
Super User
Super User

Add a calcualted column to your date table like this.

Show = 'Date'[Date] >= DATEVALUE("11/1/2017") && 'Date'[Date] <= TODAY()

Then add that field as a filter on your slicer and set it to only show TRUE

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.