Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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.
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.
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'?
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.
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
45 |