Forum Discussion
Date Slicer should populate the date range using start date and end date columns using other slicers
- 1 year ago
Hi mvinaykumar2003 ,
Thanks for the additional details and screenshot.I’ve tried this in my setup.
When Start_Date and End_Date are treated as text, the slicers respond correctly to Reporting_Period and Current_Prev_Month selections .
this works because Power BI treats them as categorical filters.
However, when using real date types, slicers are designed to show a continuous range and won’t dynamically reduce their range based on slicer-driven logic.
If your goal is to display the dynamic Start and End Dates:Use two text slicers (Start_Date and End_Date)
If your goal is to filter other visuals based on this dynamic range:
Please try this:
Keep a proper Date table:
DateTable = CALENDAR(DATE(2021,1,1), DATE(2025,12,31))Use measure like below to identify selected range:
IsInSelectedRange =VAR _min = CALCULATE(MIN('Table'[Start_Date]),ALLSELECTED('Table'))VAR _max = CALCULATE(MAX('Table'[End_Date]),ALLSELECTED('Table'))RETURNIF(MAX('DateTable'[Date]) >= _min &&MAX('DateTable'[Date]) <= _max,1,0)Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.Thank you.
Hi mvinaykumar2003 ,
Thanks for using Microsoft Fabric Community.
Here’s a quick overview of how you could dynamically control your date slicer based on Reporting Period and Current/Previous Month selections:
Overview:
-
Map each Reporting Period and Current_Prev_Month combination to its corresponding Start_Date and End_Date.
-
Use DAX to dynamically determine the relevant date range based on slicer selections.
-
Use these measures to filter your main date table or apply them as visual-level filters, so only the relevant dates appear in your visuals.
Please see this link for similar discussion: Use changing or dynamic values of Measure as Slice... - Microsoft Fabric Community
Alternately you could also generate a calculated date table for each range.
To help you further, please provide:
-
Whether your Start_Date and End_Date columns are in the same table as Reporting Period and Current_Prev_Month.
-
The structure and format of your date columns.
-
If you have a separate date dimension table.
Please provide any additional data required to assist you better.
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.
Thank you.
Thank you for helping to resolve my issue. Attaching the sample report .
All the fields comes from same table.
1. Currently I am trying to enable start date and end date as two different slicers. Based on My selection with repoting period Start date and End date time never change. As the start date and End date are picking the max and min range available.
I tried another option of having a single date slicer by adding calender table and use date column from the Calender table. So that between range can pick up the start and End date. It did not help, as it still pick the full range of dates.
I am ok to change the approach or implement any fesable solution to resolve my secnario. Based on the selection of Reporting Period and Current_Prev_Month user date range should be populated as these slicers will connect to the Fact Dimension and populate the other visuals in the report.
Appericate your support.