locked
need help with IF statement RRS feed

  • Question

  • hello,

    i am trying to create a formula in power query that i was able to create in power pivot, but it isn't working. i looked in the help file, but couldn't find anything about this type of formula, so i'm hoping someone can tell me what i'm doing wrong.

    =if (ship date]> [due date], "shipped late", "on time")

    thank you
    tracy

    Thursday, November 6, 2014 6:09 PM

Answers

  • if [ship date] > [due date] + #duration(3, 0, 0, 0) then "shipped late" else "on time"
    • Marked as answer by LadyTester Monday, November 10, 2014 5:04 AM
    Friday, November 7, 2014 2:20 AM
  • if [ship date] > [due date] then "shipped late" else "on time"
    • Marked as answer by LadyTester Friday, November 7, 2014 1:22 AM
    Thursday, November 6, 2014 7:12 PM

All replies

  • if [ship date] > [due date] then "shipped late" else "on time"
    • Marked as answer by LadyTester Friday, November 7, 2014 1:22 AM
    Thursday, November 6, 2014 7:12 PM
  • thank you curt.

    i tried to check the see if the ship date was more than 3 days after the due date like this

    if [ship date] > ( [due date] +3) then "shipped late" else "on time"

    i got an error that says that the + operator can't be used.
    i also tried it without the parens.

    i was hoping to find some syntax examples for date formulas, but haven't been able to do so.
    do you know if any exist?

    thank you

    tracy

    Friday, November 7, 2014 1:22 AM
  • if [ship date] > [due date] + #duration(3, 0, 0, 0) then "shipped late" else "on time"
    • Marked as answer by LadyTester Monday, November 10, 2014 5:04 AM
    Friday, November 7, 2014 2:20 AM
  • hi curt,

    thank you very much.
    i have never heard of or seen this #duration function. i searched for it in the help file and came up with this page, but i know that i would not have made the correlation that this was the function that i should use.

    https://support.office.com/en-us/article/List-Durations-20888ac1-9947-440c-8ddf-4b501b537881?ui=en-US&rs=en-US&ad=US

    thanks again.
    tracy

    Monday, November 10, 2014 5:06 AM