Forum Discussion

Centaur's avatar
Centaur
Helper V
4 years ago
Solved

adding Column to Source Data but doesnt show in Refresh

Hello I added a column to the source table in excel and thought that column would show after I refresh power query but I dont see it  How to show it in power query?    thank you
  • KNP's avatar
    KNP
    4 years ago

    Minor correction:

    You don't need the second instance of the column names as that is only used if you want to change the column names. So this works...

     

    let
      Source = Excel.CurrentWorkbook(),
      #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name], "tb")),
      #"Expanded Content" = Table.ExpandTableColumn(
        #"Filtered Rows",
        "Content",
        Table.ColumnNames(Table.Combine(#"Filtered Rows"[Content]))
      ),
      #"Renamed Columns" = Table.RenameColumns(#"Expanded Content", {{"Name", "Table Name"}}),
      #"Sorted Rows" = Table.Sort(#"Renamed Columns", {{"Bank Name", Order.Ascending}}),
      #"Changed Type" = Table.TransformColumnTypes(
        #"Sorted Rows",
        {
          {"Date Closed", type date},
          {"Signatories", type text},
          {"Comments", type text},
          {"Bank Relationship Manager", type text}
        }
      )
    in
      #"Changed Type"