【问题标题】:Excel, power query merging two columns with a certain conditionExcel,电源查询合并具有特定条件的两列
【发布时间】:2019-04-19 10:50:18
【问题描述】:
Column1|Column2
----------------
blank  |name
blank  |name
number |description
number |description
number |description
blank  |name
blank  |name

这是我的 excel 电源查询数据集的一个微小结构,所以我想合并这两列,但只有空白单元格必须用第二列的数据填充,如果第一列有数据,则公式必须跳过它。

【问题讨论】:

    标签: excel powerquery


    【解决方案1】:

    添加列 .. 自定义列 ...

    如果 [Column1] = null 则 [Column2] 否则 [Column1]

    然后删除多余的列

    let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each if [Column1] = null then [Column2] else [Column1]),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1", "Column2"})
    in  #"Removed Columns"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 2020-06-14
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      相关资源
      最近更新 更多