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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors