Forum Discussion
Appending a created table + IF statement in PowerQuery
- 7 years ago
No need to transform your single value to a column, instead just reference it directly like so:
Table.AddColumn(#"Fin MonthOffset", "Custom", each if #"Vlookup to Fin MonthNo"=[Fin MonthNo] then "xx" else "xy")
Hi
Pls find the link of the shared calendar file below
https://drive.google.com/open?id=1__wL6fxuhqW65mmCJ5LyiFf5yTlTo925
I would like to compare the step "Vlookup to Fin MontNo]" to the step "Fin MonthNo", however, when I do this I get an error with the IF statement. This is because the "Vlookup to Fin MonthNo" is a single value rather than a column of values or a field.
What I want to achieve: So I think first we need to convert this single value to a column, basically just duplicating the value into each row of a new column. Then this would be a field and can be compared to the Fin MonthNo.
The images of the error can be seen below
https://drive.google.com/open?id=1AUogaMWkPYYeTVNS5rJLfY-YP71u8-3u
https://drive.google.com/open?id=1nyOW2cyy0K7YSTOqMvEmEOBuiSGs6Zht
https://drive.google.com/open?id=1AKsTNlsAQEmFaBRtWXVlfkrVU3J1obEm
No need to transform your single value to a column, instead just reference it directly like so:
Table.AddColumn(#"Fin MonthOffset", "Custom", each if #"Vlookup to Fin MonthNo"=[Fin MonthNo] then "xx" else "xy")
- blytonpereira7 years agoHelper II
ImkeFThank you. Worked perfectly