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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Sarutra
Helper I
Helper I

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors