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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
garich
Frequent Visitor

Set DATE slicer default to FROM: 1st date of current month & TO: current date or latest record date

Hi,

 

How would I set the DATE slicer default below to make it:

FROM: 1st date of current month

TO: current date or latest record date

 

garich_0-1708107822888.png

 

Please note that I didn't use a DATE table in this case and just used a date field from one of my tables.

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

Hi, @garich 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1708584646277.png

 

vyaningymsft_1-1708584646281.png

 

Measure:

 

DateSlicer =

VAR _end =

    TODAY ()

VAR _start =

    EOMONTH ( TODAY (), -1 ) + 1

RETURN

    IF (

        SELECTEDVALUE ( 'Table'[date] ) <= _end

            && SELECTEDVALUE ( 'Table'[date] ) >= _start,

        1

    )

 


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

View solution in original post

3 REPLIES 3
v-yaningy-msft
Community Support
Community Support

Hi, @garich 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1708584646277.png

 

vyaningymsft_1-1708584646281.png

 

Measure:

 

DateSlicer =

VAR _end =

    TODAY ()

VAR _start =

    EOMONTH ( TODAY (), -1 ) + 1

RETURN

    IF (

        SELECTEDVALUE ( 'Table'[date] ) <= _end

            && SELECTEDVALUE ( 'Table'[date] ) >= _start,

        1

    )

 


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

Idrissshatila
Super User
Super User

Hello @garich 

 

it won't work in the between setting, you could use relative date setting

Idrissshatila_1-1708109549366.png

 

Idrissshatila_0-1708109519385.png

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thanks for your response. However, using this setting has a limitation which user cannot choose the date ranges they want specifically.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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