Oaktree
MrExcel MVP
- Joined
- Jun 20, 2002
- Messages
- 8,120
- Office Version
- 365
This should be simple, but I can't get the syntax right.
I have 5 columns in my data, each of which might contain null values:
Field A Values
Field A Percentages
Field B1 Values
Field B2 Values
Field B Percentages
I just want to add a new column that equals (Field A Values * Field A Percentages)+((-Field B1 Values + Field B2 Values)* Field B Percentages)
This is what I tried:
That compiles OK (no syntax errors detected), but it outputs "Error" in each row.
What's the *right* way to nest List.Sum and List.Product usages here?
I have 5 columns in my data, each of which might contain null values:
Field A Values
Field A Percentages
Field B1 Values
Field B2 Values
Field B Percentages
I just want to add a new column that equals (Field A Values * Field A Percentages)+((-Field B1 Values + Field B2 Values)* Field B Percentages)
This is what I tried:
Code:
#"Add Values" = Table.AddColumn(#"(Previous Step Name)", "Calculation Result", each
List.Sum(
List.Product(
{[Field A Values],
[Field A Percentages]}
),
List.Product(
{[Field B Percentages],
List.Sum(
{-[Field B1 Values],
[Field B2 Values]}
)}
)
)
)
That compiles OK (no syntax errors detected), but it outputs "Error" in each row.
What's the *right* way to nest List.Sum and List.Product usages here?