Power Query M code
let
Source = YourTable,
AddedFlag = Table.AddColumn(
Source,
"PriorityOrder",
each ([Region] = "West" or [Region] = "East") and [Amount] > 5000,
type logical
)
in
AddedFlag
Builds a conditional column that checks multiple columns together using and/or with parentheses.
let
Source = YourTable,
AddedFlag = Table.AddColumn(
Source,
"PriorityOrder",
each ([Region] = "West" or [Region] = "East") and [Amount] > 5000,
type logical
)
in
AddedFlag
Parentheses control evaluation order just like in Excel - group the or condition before combining it with and.
Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Combine AND/OR Logic in a Conditional Column.