Forum Discussion
enricofa
5 years agoRegular Visitor
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 ...
- 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"})
ImkeF
5 years agoCommunity Champion
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"})