Forum Discussion
Issue with text filtering in M / Power Query
when i do this
= Table.SelectRows(#"Unpivoted Only Selected Columns", each Text.Contains([Attribute], "Column") or Text.Contains([Attribute], "Total"))
its keep all the rows that contain column or total
however when i do the opposite, ie i want to filter these out it still brings them back, what am i doing wrong?
v-jiascu-msft hi dale, thanks but what i meant i did both (including the not), it wasn't working, the issue was actually i should have used and and not or, i had multiple conditions, that solved the problem
2 Replies
- v-jiascu-msftMicrosoft Employee
Hi vanessafvg,
That's because the "Text.Contains([Attribute], "Column") or Text.Contains([Attribute], "Total")" returns TRUE. These rows are kept finally. Please try it like below.
result = Table.SelectRows(#"Changed Type", each not ( Text.Contains([Attribute], "Column") or Text.Contains([Attribute], "Total")))
Best Regards,
Dale
- vanessafvgCommunity Champion
v-jiascu-msft hi dale, thanks but what i meant i did both (including the not), it wasn't working, the issue was actually i should have used and and not or, i had multiple conditions, that solved the problem