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
mahoneypat
Microsoft Employee
4 years agoTwo 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
StefanoGrimaldi
Resident Rockstar
4 years agowhen try your suggestion the flow keep updating none stops, maybe because of the buffle step havent try it out