Logical AND, OR criteria in Power Query

csotstot

New Member
Joined
Jun 1, 2017
Messages
24
I'm trying to build a filter in Power Query to filter rows based on the values in 2 columns (Revenue Center and Expense Center). I need to filter the table as follows:
Include rows where:
[Revenue Center] <> Revenue Center A and [Expense Center] <> Expense Center A
or
[Revenue Center] <> Revenue Center B and [Expense Center] Expense Center <>Expense Center A
or
[Revenue Center] <> Revenue Center C and [Expense Center] <> Expense Center A

Unfortunately, if I create a filter with just the first criteria (start with the simplest case and add to it mindset), all rows with Revenue Center A are filtered out of the table, then all rows with Expense Center A are filtered out. I thought Power Query would follow the normal logic and filter out only the rows that met both criteria in the and statement (I would swear I've done exactly this in earlier tables). I used both the filter wizard and building directly in the query editor with the same results as noted immediately above. As a result, I'm completely befuddled...

Am I missing something obvious?

Thanks!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Yu can write a custom column to return try or false. The syntax is as follows (case sensitive)

= if [column1]= "something" and [column2]="something else" then "true" else "false".

Then put a filter on this column.
 
Upvote 0
Hey Matt...
That's the workaround I was planning for this. It just seemed that I was missing something with not being able to use the multiple logical criteria across columns.
I'm guessing from your response that my recollection of being able to filter the way I had intended was incorrect :).

Thanks!
Charlie
 
Upvote 0

Forum statistics

Threads
1,223,708
Messages
6,174,006
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top