Forum Discussion

New2PowerBI's avatar
New2PowerBI
Helper III
9 years ago

Date Slicers

I have many Table and columns, many of them with multiple sets of information and connected to different visualizations.

 

I have one visualization in particular where a customer wants to know everything that their direct reports have coming due from "TODAY" thru next year (365 days); how can I best achieve it?

 

For testing, I was able to add a Filter and enter the date range, but that seems to be something I'd have to redo everytime.  I know there has got to be a better way so that whenever the data is accessed it knows it's looking for data that is due that day thru 365 days. 

 

I read through some of the other Slicer posts but didn't quite find what I was looking for.  Any help will be greatly appreciated.

 

Thanks!

9 Replies

  • Can you share your data mode for better answer but here is something I think will work:

     

    You need add two columns

      

    Current Date = TODAY()

     

    Due in next 365 days = if(myTable[DueDate] >= TODAY() && myTable[DueDate] <= DATEADD(CurrentDate, 365, DAY), 1, 0)

    And then drop this new column on filter and select where value is 1

    • New2PowerBI's avatar
      New2PowerBI
      Helper III

      I think we are close.  :-)

       

      All values resulted in "0" but I should have both 0 and 1 based on data.  Here is what I entered into 2nd column:

       

      Due in next 365 days = if(PM[NEXTDATE] >= TODAY() && PM[NEXTDATE] <= DATEADD(PM[Current Date], 365, DAY), 1, 0)

       

      Do you think I need to adjust the format on my [NEXTDATE] column?  The current values' format is (example):

       

      4/1/2017 12:00:00 AM

       

       

      • parry2k's avatar
        parry2k
        Super User

        Hello New2PowerBI

         

        Can you share sample data model since I don't know all the details and I proposed the situation based on some assumptions, if you can share the columns you have, it will be helpful :)