Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Date/Time Intelligence Formula

I am trying to write a filter for a [Due Date] column within my dataset, I have a [DateKey] for a date heirarchy listing. My goal is to determine a few things,

 

If Due Date is less than Today() = 'Past Due'

If Due Date equals Today() = 'Due Now'
If Due Date is greater than Today() but not greater than itself = 'Upcoming'


Example

Due Date     Status
10/1/2017    Past Due
10/31/2017   Upcoming
10/25/2017   Due Now
10/20/2017   Past Due
12/31/2017   


Ultimately I am attempting to filter/show only relevant date pre-due date within my visual and exclude anything beyond a due date. I know this can be achieved within a slicer however being that I have multiple orders I am looking at, a slicer isn't really an option.

  • Anonymous's avatar
    Anonymous
    8 years ago

    I think I have finally figured out a solution, what I ended up doing was creating an IF measure which determined if my receive date was greater than my ship date it would return "1". After which I then created new IF measures for each of my values which referenced my shipping measure and if a 1 was present it would be blank, otherwise it would display it's data.

    The matrix visual seems intelligent enough to then omit those blank rows thus not displaying unwanted data. 

    Thank you all for your help, I couldn't of got here without you.

7 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    Anonymous you can create a calculated column with a switch statement and then filter by your values

     

     

     

    i.e 

     

    filter =
    SWITCH (
    duedate < TODAY (), "Past Due",

    duedate = TODAY (),"Due Now",

    duedate > today, "Upcoming"
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks vanessafvg 

      Anytips on how I could also filter out that which is beyond the due date?

      Essentially this


      If Due Date is greater than Due Date = 'Not Due'

      I have been racking my brain looking for a solution, but with no anchor point to compare I am a bit lost.

      • vanessafvg's avatar
        vanessafvg
        Community Champion

        Anonymous i am a bit confused how can it be > than itsself, or is it 2 different fields?  what defines the due date and how can it be greater than itself.?