Forum Discussion

shuklasuyash's avatar
shuklasuyash
New Member
5 years ago

Date slicer

I have a query regarding Power BI. I have a data that has start and end date .
 

I am trying to create a slicer (Slider type)  which has first input as a start date and other input as end date to filter the miles data. But I am facing the issue as slicer is applied on single column.Due to which I have to create two slicers ,one for start and other one for end date. I want both start and end date in one slicer.Please suggest me what to do in this case.

 

3 Replies

  • shuklasuyash , Start date and end date are from date slicer or are from two-column of the table.

     

    One of the ways is to join with them with one or more date tables. And have some inactive join , use userelationship to activate the join

     

    https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

     

    Also, check

    Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

    How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg

     

    or

     

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

    • shuklasuyash's avatar
      shuklasuyash
      New Member

      As you can see that data is from a single table 

      I am trying to create a slicer which has first input as a start date and other input as end date to filter the miles data. But I am facing the issue as slicer is applied on single column.Due to which I have to create two slicers ,one for start and other one for end date. I want both start and end date in one slicer.
       
      As you can see between slicer has two date selection.What I want is that first box in that should take start date as input and other box should take end date as input
      Please suggest me what to do in this case.
      • v-deddai1-msft's avatar
        v-deddai1-msft
        Community Support

        Hi shuklasuyash ,

         

        You can create a date table in your data model, use the date column from it as slicer ,and then add filter(table,table[start date]>=MIN(Date[Date])&&table[end date]<=MAX(Date[Date])) to all measures you used in the report or add visual level filter. It's quite a big work.

         

        As a workaround, I suggest you create two slicer , for start date you change the slicer to after mode for end date you can change the slicer to before mode. Please refer to https://radacad.com/from-and-to-date-slicers-in-power-bi-filtering-based-on-two-fields

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

         

        Best Regards,

        Dedmon Dai