Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculated Column question

Hello Community  -  I've been tasked by management to track the days between various dates.    These date difference formulas I have already created. 

 

The 2nd part of the request, is that we need to assign orders a categorization, based on the criteria below.  

 

Quick Ship    =   Orders between 0-$40,000 have a 2nd business day after CH release date set as due date

10 Day     =    Orders between $40k - $100k have a 10 business day after CH release date set as due date

30 Day     =  Orders over 100k have a 30 day from CH release date assigned.

 

I think the way to handle this is to create a calculated column using VAR and IF to say "if order value <= 40,000 then "Quick Ship"

 

And same for the other two categories.   Then, put this calculated column as a filter on my table visual where I have the days between dates measurements.     Is this the right way go about this?

  • Looks like you could just make a calculated column with a SWITCH(TRUE(), Order[Amount] <40000, "Quick Ship", Order[Amount] <100000, "10 Day" ... and so on.  You could also then make a Due Date column with another SWITCH() to add days to the CH Release Date based on the category value in the new column.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

     

2 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Looks like you could just make a calculated column with a SWITCH(TRUE(), Order[Amount] <40000, "Quick Ship", Order[Amount] <100000, "10 Day" ... and so on.  You could also then make a Due Date column with another SWITCH() to add days to the CH Release Date based on the category value in the new column.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks mahoneypat 

       

      Here is the final result

       

      Shipment Category =
      SWITCH( TRUE(),
      'Flu Shipped'[Order Value] <= 40000,"Quick Ship",
      'Flu Shipped'[Order Value] < 100000,"10 Day",
      "30 Day"
      )