Hello!
Is it possible to use PowerQuery to add a column with additional values, to an existing list? To clarify, I have a list of SKUs. I would like to extend the list, to add a State column, next to each SKU. For example SKU = ABC111; replicate ABC111 and add a State column as SKUABC111 NSW, SKU ABC111 VIC ...
I'm thinking insert column and fill, but am stuck how to do this.
Please see attached example, of the two original tables, and the the desired output.
Many thanks.
Hello again,
I figured this out. By Adding Custom Column, and entering the formula: ={"NSW","QLD","VIC","SA","WA"}
However, this leads to another question. Is there a Custom Column formula to add the current month? And a Custom Column formula to add the following month, in a new column? Month and following month would be based on local day.
Thanks, Danielle
Hi Danielle,
You can certainly use the formula approach. In the file attached you'll see I've added a column by referencing the State table, which means you can add/remove/change values in the State table and it will automatically update when the query is refreshed.
As for your month column question. You can use a time stamp function to get the current month, but this means when you refresh the query it will pick up the latest month and that might or might not be what you want. If you want a fixed month, then simply add a custom column with the month like so:
="May" or =5
It will enter this value in the whole column.
Alternatively, you can use:
=Date.Month(DateTime.LocalNow()))
And for next month:
=Date.Month(DateTime.LocalNow()))+1
See file attached.
Mynda
Thanks so much, Mynda.
This solution works perfectly.