Forum Discussion

mvinaykumar2003's avatar
mvinaykumar2003
Regular Visitor
1 year ago
Solved

Date Slicer should populate the date range using start date and end date columns using other slicers

Hi, My Date Slicer date range should be dynamically populated using the start date and end date columns. This date range selection is again controlled by other slicers. Below is the example.    I ...
  • v-veshwara-msft's avatar
    v-veshwara-msft
    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')
    )
    RETURN
    IF(
        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.