Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Sarutra
Frequent Visitor

Power bi query very slow

hello,

Power bi query very slow. 

how to fix?

 

#"Pridėta rodyklė" = Table.Buffer(Table.AddIndexColumn(#"Filtruotos eilutės5", "Indeksas", 1, 1, Int64.Type)),
#"Pridėtas pasirinktinis1" = Table.AddColumn(#"Pridėta rodyklė", "Indeksas Invert", each [Indeksas]*-1),
#"Pridėtas pasirinktinis2" = Table.AddColumn(#"Pridėtas pasirinktinis1","CumDebet",(i)=>List.Sum(Table.SelectRows(#"Pridėtas pasirinktinis1", each [Customer code]=i[Customer code] and [Indeksas]<=i[Indeksas]) [Debet]), type number )

in
#"Pridėtas pasirinktinis2"

 

 

thank you

Arturas

2 REPLIES 2
AlexisOlson
Super User
Super User

This is a really inefficient way to calculate cumulative columns in Power Query. You'll have much better performance if you used a method like List.Accumulate instead.

 

Check out this post for an example:
https://community.powerbi.com/t5/Desktop/How-to-do-a-running-Sum-by-group-in-Power-Query/m-p/290123

thanks, i'll try

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors