Forum Discussion
StefanoGrimaldi
Resident Rockstar
4 years agoM Languague Optimization Sugggestion Specific Case
hey guys, I have a little query Im trying to optimize and looking for point and tips here have already done some progress but need some help futher optimizing it, any suggestion would be great (The "...
- 4 years ago
Two suggestions to try, since you are referencing the previous step more than once:
#"Personalizado agregado" = Table.AddColumn(#"Tasa expandido", "Monto Articulo (Descento Doc Aplicado) (Pesos Dominicanos)", each let doc = [Numero Documento], filtered = Table.SelectRows( #"Tasa expandido", each [Numero Documento] = doc), cantidadlineas = Table.RowCount(filtered), totaldoc = List.Sum(filtered[#"Total Articulo (Descuento Aplicado) (RD)"]), porcientoxlinea = ([#"Total Articulo (Descuento Aplicado) (RD)"] / totaldoc), Resultado = [#"Total Articulo (Descuento Aplicado) (RD)"] - (porcientoxlinea*(([#"% Descuento Factura (RD)"])/100)*totaldoc) in Resultado),#"Tasa expandido" = Table.Buffer(Table.ExpandTableColumn(#"Consultas combinadas", "Tasa", {"Tasa"}, {"Tasa.1"})),Pat
Anonymous
4 years agoNot applicable
I would wrap the inputs of your list arithmetic in List.Buffer. Feeding buffered lists to your list functions is a HUGE optimization that needs to be taught in kindergartens worldwide.
--Nate