各位老师好:使用POWER QUERY 导入标题是日期格式的列名,如果数据源日期变化将不能更新,用什么方法可以实现动态更新。谢谢!
let
源 = Excel.Workbook(File.Contents("C:\Users\lijinlong.SDS0\Desktop\测试\计划.xlsx"), null, true),
Sheet1_Sheet = 源{[Item="Sheet1",Kind="Sheet"]}[Data],
更改的类型 = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}, {"Column2", type date}, {"Column3", type date}, {"Column4", type date}, {"Column5", type any}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}, {"Column9", type any}, {"Column10", type any}, {"Column11", type any}, {"Column12", type any}, {"Column13", type any}, {"Column14", type any}, {"Column15", type any}, {"Column16", type any}, {"Column17", type any}, {"Column18", type any}, {"Column19", type any}, {"Column20", type any}}),
提升的标题 = Table.PromoteHeaders(更改的类型, [PromoteAllScalars=true]),
更改的类型1 = Table.TransformColumnTypes(提升的标题,{{"父零件", Int64.Type}, {"2021/6/4", type date}, {"2021/6/5", type date}, {"2021/6/6", type date}, {"2021/6/7", Int64.Type}, {"2021/6/8", Int64.Type}, {"2021/6/9", Int64.Type}, {"2021/6/10", Int64.Type}, {"2021/6/11", Int64.Type}, {"2021/6/12", Int64.Type}, {"2021/6/13", Int64.Type}, {"周小计", Int64.Type}, {"2021/6/14", Int64.Type}, {"2021/6/15", Int64.Type}, {"2021/6/16", Int64.Type}, {"2021/6/17", Int64.Type}, {"2021/6/18", Int64.Type}, {"2021/6/19", Int64.Type}, {"2021/6/20", Int64.Type}, {"周小计_1", Int64.Type}}),
逆透视的列 = Table.UnpivotOtherColumns(更改的类型1, {"父零件"}, "属性", "值")
in
逆透视的列
|