Slow calculation of calculated column in Power Pivot

Torn85

New Member
Joined
Nov 14, 2019
Messages
2
Hi, I'm having a performance issue while running the following formula:

"=Calculate(sum(lines[CB unit]),Filter(Lines,Lines[Index]<=earlier(Lines[index]))"

I'm only iterating over 150K rows, but the calculation times out and never seems to finish.

It works fine with 2K rows, but really starts to slow down around 20K rows.

The goal is to get a running total of product quantity by an index column.

Can anybody offer me some guidance on this?

Thanks
-T
 

Torn85

New Member
Joined
Nov 14, 2019
Messages
2
I should also note that I am running a power query with the following code before loading it to power pivot:

let
Source = Excel.Workbook(File.Contents("C:\Users\rjg01\Documents\DATAMODEL FILES\ORDER_LINES_TABLE-1.xlsx"), null, true),
#"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Table")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Name", "Data"}),
#"Expanded Data" = Table.ExpandTableColumn(#"Removed Other Columns", "Data", {"Order", "Line", "Customer Site Date", "Site Date Actual", "Due Date", "Earliest Delivery Date", "Ship Date Actual", "Last Ship Date", "Qty Ordered", "Invoiced", "Status", "Item", "Customer Item", "Unit Price", "Est Cost", "Approval Drawing Due", "Approval Drawing Actual", "Approval Drawing Returned", "Approval Drawing Returned2", "BOM Release Due", "BOM Release Actual", "Ship To", "Job", "Serial Number"}, {"Order", "Line", "Customer Site Date", "Site Date Actual", "Due Date", "Earliest Delivery Date", "Ship Date Actual", "Last Ship Date", "Qty Ordered", "Invoiced", "Status", "Item.1", "Customer Item", "Unit Price", "Est Cost", "Approval Drawing Due", "Approval Drawing Actual", "Approval Drawing Returned", "Approval Drawing Returned2", "BOM Release Due", "BOM Release Actual", "Ship To", "Job", "Serial Number"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Data",{{"Item.1", "Item"}}),
#"Cobmined Forecast" = Table.Combine({#"Renamed Columns", FORECAST_LINES}),
#"Added Index1" = Table.AddIndexColumn(#"Cobmined Forecast", "Index", 1, 1),
#"Sorted Index Ascending" = Table.Sort(#"Added Index1",{{"Index", Order.Ascending}}),
#"Add CB Qty." = Table.AddColumn(#"Sorted Index Ascending", "CB Unit", each if Text.StartsWith([Item], "X") then [Qty Ordered] else if List.AllTrue({Text.StartsWith([Item], "ZGCB"),[#"Unit Price"] > 30000}) then if [Qty Ordered] > 1 then 1 else [Qty Ordered] else 0, type number),
#"Removed Columns" = Table.SelectColumns(#"Add CB Qty.",{"Order", "Line", "Index", "CB Unit"}),
#"Buffered Table" = Table.Buffer(#"Removed Columns")
in
#"Buffered Table"


I should further note that, without any modifications in Power Query, my data file, in Power Pivot, has no problems performing a similar expanding range summation. It only takes a few seconds to calculate over the 150K rows. Therefore, I must have some issue in Power Query.

I've looked into buffering my table, but that has not helped me. Perhaps, I'm not buffering at the right places?
 

Forum statistics

Threads
1,077,895
Messages
5,337,054
Members
399,120
Latest member
Sravankumar

Some videos you may like

This Week's Hot Topics

Top