Forum Discussion
REVISED QUESTION: Filtering issues in column
- 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
- 10 years ago
very strange.
M is case sensitive - so does "shipping" actually match your text or should it be "Shipping" instead?
- 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.
very strange.
M is case sensitive - so does "shipping" actually match your text or should it be "Shipping" instead?
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.
- ImkeF10 years agoCommunity Champion
Have a look at this nice article that shows what pivot in Power Query actually does: http://blog.crossjoin.co.uk/2013/11/25/pivoting-data-in-power-query/
- heathernicole10 years agoContinued Contributor
Now ... I want to make sure I understand exactly WHY that worked and what that little code did.
I've never used pivot columns before.
Can you give a breakdown of what we did - in layman's terms?
I think I know but I want to make sure I understand. I'm sure I'll have to do something similar to this many times over.