Forum Discussion

enricofa's avatar
enricofa
Regular Visitor
5 years ago
Solved

Power Query group-by performance

Hi guys,   I have a performance issue with a query that get stuck on the group-by step, and I would like to understand if there's something I can do to improve the query.   Basically, I have two ...
  • ImkeF's avatar
    5 years ago

    Hi enricofa ,

    these transformations shouldn't be terribly slow per se.
    So I'd recommend to buffer the data that goes into them:

    Appended = Table.Buffer(Table.Combine({Parameters1, Parameters2}))
    Grouped = Table.Group(Appended, {"Param"}, {{"Param_Type", each List.Max([Type]), type text}, {"Count", each Table.RowCount(_), Int64.Type}})
    AddedSource = Table.AddColumn(Grouped, "Source", each if [Param_Type] = null
    then "1"
    else if [Count] = 1
    then "2"
    else "Both")
    RemovedCount= Table.RemoveColumns(AddedSource, {"Count"})