Power Query Create Column Syntax

detriez

Board Regular
Joined
Sep 13, 2011
Messages
193
Office Version
  1. 365
Platform
  1. Windows
I am trying to add a column with this criteria

if
(
[AnnualRevenue] >= 250000000
and
[Has Products]="True"
and
[Is Target]="True"
and
[Marketing Country]="True"
)
or
[AccountTypeGroup]="Client"
or
[Is Target]="True"
then "True" else "False"


I'm not sure I have the syntax correct

Code:
if([AnnualRevenue] >= 250000000 and [Has Products]="True" and [Is Target]="True" and [Marketing Country]="True") or [AccountTypeGroup]="Client" or [Is Target]="True" then "True" else "False"
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
maybe
Power Query:
= if [AnnualRevenue] >= 250000000 and [Has Products] = true and [Is Target] = true and [Marketing Country] = true or [AccountTypeGroup] = "Client" or [Is Target] = true then true else false
true/false or true/false or true/false then true/false
I don't know if it will work because syntax is syntax but result is ?
 
Last edited:
Upvote 0
Argh..
My logic was wrong... (I was using [Is Target] in the and as well as the or portion)

I'm trying to get to..

If [Is Target] is true then True
or else if
If [AccountTypeGroup] =Client then True
or else if
[AnnualRevenue] >= 250000000 and [Has Products] = "True" and [Marketing Country] = "True" then True

else False

THis doesnt get me there either

Code:
if [AccountTypeGroup] = "Client" then true else if [Is Target] = "True" then true else if [AnnualRevenue] >= 250000000 and [Has Products] = "True" and [Marketing Country] = "True" then true else false
 
Upvote 0

Forum statistics

Threads
1,223,754
Messages
6,174,314
Members
452,554
Latest member
Louis1225

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