Forum Discussion

heathernicole's avatar
heathernicole
Continued Contributor
10 years ago
Solved

REVISED QUESTION: Filtering issues in column

Original: Need to create a calculated column that says this:   Shipping charges = IF this "lineItemcolumn" contains "shipping", then give value of this "lineItemAppliedAmount".    No matter how I...
  • ImkeF's avatar
    ImkeF
    10 years ago

    There must be blanks in the line item column then.

    In this case you need to wrap your formula in the custom column in a "try ... otherwise".

    So it looks like this:

     

    try if Text.Contains([lineItemcolumn], "shipping") then "shipping" else "InvoicedAmount" otherwise "InvoicedAmount"

     

    This will also allocate the Invoiced Amount if the column is blank

  • ImkeF's avatar
    ImkeF
    10 years ago

    very strange.

    M is case sensitive - so does "shipping" actually match your text or should it be "Shipping" instead?

     

  • ImkeF's avatar
    ImkeF
    10 years ago

    another check would be to use this code in the custom column instead:

     

    = try if Text.Contains([lineItemcolumn], "shipping") then "shipping" else "InvoicedAmount" otherwise "AllWrong"

     

    Then check in how the pivot looks: Do all numbers show up in "AllWrong"? Then sth in the Text.Contains - expression is completely wrong.