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,078,541
Messages
5,341,070
Members
399,415
Latest member
salterian1974

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top