Forum Discussion
SvenJ
4 years agoHelper III
Remove last column / Import from folder
I´m trying to import excel files from a folder. It works fine, if the excel files are simular. If a column is missing i get an error and i don´t know how to fix it. It would be great to get help on t...
- 4 years ago
You can add a step to remove the last column.
let Quelle = Excel.Workbook(Parameter1, null, false), BWA_sheet = Quelle{[Item="BWA",Kind="Sheet"]}[Data], FilterNullAndWhitespace = each List.Select(_, each _ <> null and (not (_ is text) or Text.Trim(_) <> "")), #"Entfernte untere Zeilen" = Table.RemoveLastN(BWA_sheet, each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false), #"Entfernte oberste Zeilen" = Table.Skip(#"Entfernte untere Zeilen", each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false), #"Entfernte letzte Spalte" = Table.RemoveColumns(#"Entfernte oberste Zeilen", {List.Last(Table.ColumnNames(#"Entfernte oberste Zeilen"))}) in #"Entfernte letzte Spalte"
SvenJ
4 years agoHelper III
Great! Thanks for your help. Last question. I want to have the percentage different between the years. For example, i select a filter years 2019 & 2021 - i want to have the difference between the values of each month. If i select 2018 & 2019, the difference between this years. If i select 3 years, the difference of each year. 2018 (difference in %) 2019 (difference in %) 2021
AlexisOlson
4 years agoSuper User
This belongs as a separate post (probably in DAX rather than Power Query).