Forum Discussion
Use power query to split csv file not multiple tables
- Anonymous5 years ago
#"Raggruppate righe" = Table.Group(YOUR_LAST_STEP, {"Attendee Report", "Column3"}, {{"all", each Table.PromoteHeaders(Table.Skip(_))}},GroupKind.Local,(x,y)=>Number.From(x[Column3]<>null or y[Column3]=null)), #"Rimosse colonne" = Table.RemoveColumns(#"Raggruppate righe",{"Column3"}) in #"Rimosse colonne"it is not clear to me where (in what statement) you get the error you report. My code is just pretty much the following two lines. Load the table you want and queue these lines by adapting the name YOUR_LAST_STEP. In theory, one could also make a function of these lines, if it were useful.
Anonymous I've been playing around with it but still can't get it to work with csv files or folders. The error in my previous comment was coming from the fact that I needed to assign new column names when importing csv or folders. I renamed them to follow the logic in your grouping expressions. The error went away but the output is not correct. It gives me a table of empty tables. For some reason it looks like the grouping expression isn't working. Can you explain the logic of #"Raggruppate righe" and #"Rimosse colonne" in more detail?
In the link below I have my pbix file and samples of the logs in both csv and xlsx
https://drive.google.com/drive/folders/19KcLeM44MVaNq5MP0bGQzUujwid7c3Km?usp=sharing
I was able to figure out why these expressions were not filtering properly for csv files but worked for xlsx files. Blank values in xlsx files are imported into PBI as "null" where blanks are treated differenctly in csv files. To solve this issue I had to replace all blanks in csv with "null" values.