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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SparkDataGuru
Frequent Visitor

Two Date Slicers: Setting up pre-selected dates and custom calendar in same report

I'm currently having trouble setting up PowerBI reports to utilize both Custom Date Range Slicers (Such as pre-selecting from YTD, QTD, MTD, etc) and also combining it with the flexiblity of a Custom Date Selector/Slider.

 

When reviewing more recent tutorials online I've noticed it seems reports can either come in the form of pre-selected date ranges or just using the date selector slider but never both at the same time!

 

In some older videos I've seen on Youtube (such as this one from 3 years ago: https://www.youtube.com/watch?v=fKygF7VEJnQ), there used to be ways to disable the custom date selector/slider when a user is using the pre-selected date ranges, and to re-enable it when the user selects 'Custom'. However, it seems with the most recent version of PBI, the filter method no longer actually disables the date selector slider....


In my screenshot below, when selecting the pre-selected date ranges (MTD, QTD, YTD), it updates all my visuals but fails to update the proper dates on the calendar slider and vice-versa.

Any suggestions or resources on how I can get both functioning in a report? It's a requirement for the user to be able to quickly select preselected date ranges, but also revert back to a custom date when needed.

 

SparkDataGuru_0-1733187896224.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @SparkDataGuru 

 

I have a tutorial and a sample pbix on YouTube. https://youtu.be/A3XvBiNdjXI?si=OvnowbQ8OtbvnO8o 

If you need both slicers to filter each other, you will need to set the direction of the relationship to both, use a visual filter or use the date column from the preset table. Play around with the sample pbix. Each approach will have its own pros and cons.

danextian_0-1733195383206.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @SparkDataGuru 

 

I have a tutorial and a sample pbix on YouTube. https://youtu.be/A3XvBiNdjXI?si=OvnowbQ8OtbvnO8o 

If you need both slicers to filter each other, you will need to set the direction of the relationship to both, use a visual filter or use the date column from the preset table. Play around with the sample pbix. Each approach will have its own pros and cons.

danextian_0-1733195383206.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks Danextian, I watched the entire video and appreciate the very thorough walkthrough. Was able to create a similar setup with the preset and date slider, and also successfully have the date slider update when the preset was utilized.

Just wondering if when changing the date via the date slider, is there a way to automatically have the preset slicer change to 'Custom'? 

Hi @SparkDataGuru 

 

That is not currenlty possible. The dates in the date slicer will be limited based on the presets. You can write a measure to visually filter a slicer instead but with some limitations.

Current Date Count = 
COUNTROWS(d_Dates)
Total Count by Preset = 
CALCULATE (
    DISTINCTCOUNT ( DatePresets[Date] ),
    ALLEXCEPT ( DatePresets, DatePresets[Preset] )
)
Filter to Custom = 
VAR __DateCount = [Current Date Count]
VAR __PresetTotal = [Total Count by Preset]
VAR __custom =
    CALCULATE ( IF ( __DateCount < __PresetTotal, "Custom" ), ALL ( DatePresets ) )
RETURN
    IF (
        __custom = SELECTEDVALUE ( DatePresets[Preset] )
            || NOT ( ISFILTERED ( d_Dates ) ),
        1
    )

The initially selected preset will not be deselected. The slicer will be filtered to custom  but  will not be selected.

danextian_0-1733296497492.png

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.