Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Conditionally combining multiple rows into one column

I have a folder full of files in the format below. I want to load these into PowerBI using Power Query. See attached picture, I colored every column with its own color. Loading and splitting the co...
  • Anonymous's avatar
    Anonymous
    7 years ago

    PhilC thank you for your help, I think I solved it using parts of your script.

     

    1. Import file in 1 column

    2. Insert new column, with values of original column only if the line starts with (ERROR, WARN, FATAL). So the messages containing multiple lines will not be put into this new column

    3. Fill new column down

    4. Group by on this new column as the key (it contains a timestamp so thats possible), and the original column as the value, and removing linefeeds in the grouping process:

    #"Group" = Table.Group(#"Fill Down", {"Temp"}, {{"Column1", each Text.Combine([Column1],"#(lf)"), type text}})

    5. This solves the original problem. Now split by delimiters and set column types to finish

     

    PhilC please explain what your thinking process was by adding the index column and the logic that uses this index column? I didn't need this part and this made it slow. Maybe I'm missing something?