简体   繁体   English

Excel - Power Query - 用公式填充导入的列

[英]Excel - Power Query - fill imported columns with formulas

I have a Query in place, which imports some empty columns.我有一个查询,它导入了一些空列。 I want those columns to be filled with some formulas, referencing other columns (from the same query).我希望这些列填充一些公式,引用其他列(来自同一查询)。

I tried:我试过:

  • "Replace Values" option, but that does not work for formulas. “替换值”选项,但这不适用于公式。
  • Removing the empty columns and adding them as new (non-query) columns works, but messes up the order of the columns, which needs to be the same as it is now (this is a request from the users of the file).删除空列并将它们添加为新的(非查询)列是可行的,但会弄乱列的顺序,这需要与现在相同(这是来自文件用户的请求)。 So this was also a dead end.所以这也是一个死胡同。
  • of course, I tried to enter the formula manually into the empty columns, but on refresh, the formulas were overwritten by the imported blanks (no surprise here)当然,我尝试将公式手动输入到空列中,但在刷新时,公式被导入的空白覆盖(这里并不奇怪)

Is this even possible ?这甚至可能吗?

Power Query supports adding " Custom Columns " which are similar to adding a formula column in excel. Power Query 支持添加“ 自定义列”,类似于在 Excel 中添加公式列。 You can add a column in any sequence you may want and also change the sequence if required.您可以按您想要的任何顺序添加列,也可以根据需要更改顺序。

To help with this there is also a " Create Column from Example " where you can enter a sample output in few rows and it will automatically calculate the formula for you.为了帮助解决这个问题,还有一个“ 从示例创建列”,您可以在其中输入几行示例输出,它会自动为您计算公式。

Additional resources:其他资源:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM