Forum Discussion
Two Date Slicers: Setting up pre-selected dates and custom calendar in same report
- 1 year ago
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'?
- danextian1 year ago
Super User
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.