简体   繁体   English

cvs 源数据(合并文件夹)中新添加的列 - 在 Power BI 的电源查询部分中刷新时不出现

[英]Newly added column in cvs source data (combined folder) - not appearing when refreshing in power query section in Power BI

Still stumbling my way through Power BI.仍然在 Power BI 中磕磕绊绊。
I have added a new column in just a few of the files in the folder that I had already pulled in and combined but this column is not appearing once refreshed.我在文件夹中的几个文件中添加了一个新列,这些文件我已经拉入并合并,但是一旦刷新,该列就不会出现。 Despite the endless research, I am at a loss as to how to fix this in advanced editor.尽管进行了无休止的研究,但我不知道如何在高级编辑器中解决这个问题。 Your assistance would be greatly appreciated.您的帮助将不胜感激。
Code below:下面的代码:

Source = Folder.Files("C:\Users\Sarah\OneDrive\FEEDLOT\APS Files\Original Files"),
    #"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
    #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
    #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
    #"Removed Errors1" = Table.RemoveRowsWithErrors(#"Removed Other Columns1", {"Transform File"}),
    #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Errors1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"Tag Number", type text}, {"Electronic ID", type text}, {"NLIS", type any}, {"Date", type datetime}, {"Live Weight (kg)", type number}, {"Draft", type any}, {"Condition Score", type any}, {"Notes", type any}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Source.Name", "APS Source File Name"}, {"Tag Number", "Visual ID"}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Renamed Columns", "APS Source File Name", Splitter.SplitTextByEachDelimiter({"-"}, QuoteStyle.Csv, true), {"APS Source File Name.1", "APS Source File Name.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"APS Source File Name.1", type text}, {"APS Source File Name.2", type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"APS Source File Name.2"}),
    #"Renamed Columns2" = Table.RenameColumns(#"Removed Columns",{{"APS Source File Name.1", "APS Source File Name"}})

Don't try to fix this in Advanced Editor alone.不要尝试仅在高级编辑器中解决此问题。 Instead, step through the code and inspect the result after each step.相反,单步执行代码并在每一步之后检查结果。 That will show you where the problem is.这会告诉你问题出在哪里。

Without seeing your data it is not possible to tell you where in your code you need to make changes, but you will be able to see that if you step through the actions one by one.如果不查看您的数据,就无法告诉您需要在代码中的哪个位置进行更改,但是如果您逐个执行操作,您将能够看到这一点。

First of all, check twice you are reading the correct file and backup the current script.首先,检查两次您正在读取正确的文件并备份当前脚本。 Then, I would try two approaches:然后,我会尝试两种方法:

  1. Delete the steps until you find the one that causes the problem.删除这些步骤,直到找到导致问题的步骤。 Then, fix the step causing the issue and check if at the end of the pipeline the columns appear.然后,修复导致问题的步骤并检查是否在管道末端出现列。

If this does not solve the issue, I would go with the second approach:如果这不能解决问题,我会用第二种方法 go :

  1. Create a new PBIX, and one-by-one re-implement all the steps until you find the one causing the new columns to disappear.创建一个新的 PBIX,并一一重新执行所有步骤,直到找到导致新列消失的步骤。

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

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