Forum Discussion

moyedgi's avatar
moyedgi
Regular Visitor
3 years ago
Solved

Two date slicers for start and end date

Hello,   I want to have two slicers for each start and the end date that will show values within that selected time range. I do not want to use a single slicer that has a slider to select dates. ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi moyedgi ,

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

    Table 2 = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))

    Table3:

    Table 3 = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))

    2. create measure with below dax formula

    Measure =
    VAR st_date =
        SELECTEDVALUE ( 'Table 2'[Date] )
    VAR ed_date =
        SELECTEDVALUE ( 'Table 3'[Date] )
    VAR tmp =
        CALENDAR ( st_date, ed_date )
    VAR cur_date =
        SELECTEDVALUE ( 'Table'[Date] )
    RETURN
        IF ( cur_date IN tmp, 1, 0 )
    

    3. add two slicer with Table2 and Table3, add table visual with Table fields and add measure to it filter pane

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.