Forum Discussion
jk8979356
5 years agoRegular Visitor
How do I nest an IF statement rather than create a new column for it?
I am using Power Query to take year to date sales data and compare it to our estimated total sales for the entire year. With this YTD vs full year comparison I am creating a "Forecast Factor" number ...
lbendlin
Super User
5 years agoYou could do things like
= Table.AddColumn(#"Added Qty Forecast Column", "Sales Forecast", each if [Amount] <= 0 then [Amount] else [Amount] / (if List.Sum(#"Changed Type2"[Amount]) <= #"2020forecast"{0}[Column2] then (List.Sum(#"Changed Type2"[Amount]) / #"2020forecast"{0}[Column2]) else 1))
But what's the big issue here? That additional column does no harm. You can remove it again after the computation if you are concerned about memory.