Forum Discussion

ProblemSolver's avatar
ProblemSolver
Regular Visitor
3 months ago
Solved

I am having errors with the refresh

I am having error tried everthing that can be changed but nothing is working and it is taking forever like mire then 30 minutes to load. Here is my M Code I do have multiple table but I am assuming this table/Query is creating problem:

let
Source =
Oracle.Database(
"Oracle",
[
Query = "
SELECT
y.inventory_item_id,
y.oracle_item,
y.item_description,
y.description,
y.primary_uom_code,
y.cross_reference,
y.cross_reference_type,
y.customer_part_number,
y.list_line_id,
y.list_header_id,

-- NEW values (most recent row)
y.start_date_active AS new_start_date,
y.end_date_active AS new_end_date,
y.operand AS new_operand,

-- OLD values (immediately previous row)
y.old_start_date,
y.old_end_date,
y.old_operand,

y.price_list_name,
y.price_list_description,
y.account_number,
y.account_name,

CASE
WHEN y.old_operand IS NULL THEN 'First Record'
WHEN y.operand <> y.old_operand THEN 'Changed'
ELSE 'No Change'
END AS price_change_flag
FROM
(
SELECT
x.inventory_item_id,
x.oracle_item,
x.item_description,
x.description,
x.primary_uom_code,
x.cross_reference,
x.cross_reference_type,
x.customer_part_number,
x.list_line_id,
x.list_header_id,
x.start_date_active,
x.end_date_active,
x.operand,

LAG(x.start_date_active) OVER (
PARTITION BY x.inventory_item_id,
x.list_header_id,
x.account_number
ORDER BY x.start_date_active, x.list_line_id
) AS old_start_date,

LAG(x.end_date_active) OVER (
PARTITION BY x.inventory_item_id,
x.list_header_id,
x.account_number
ORDER BY x.start_date_active, x.list_line_id
) AS old_end_date,

LAG(x.operand) OVER (
PARTITION BY x.inventory_item_id,
x.list_header_id,
x.account_number
ORDER BY x.start_date_active, x.list_line_id
) AS old_operand,

ROW_NUMBER() OVER (
PARTITION BY x.inventory_item_id,
x.list_header_id,
x.account_number
ORDER BY x.start_date_active DESC, x.list_line_id DESC
) AS rn,

x.price_list_name,
x.price_list_description,
x.account_number,
x.account_name
FROM
(
SELECT DISTINCT
msib.inventory_item_id,
msib.segment1 AS oracle_item,
msib.description AS item_description,
msib.description AS description,
msib.primary_uom_code AS primary_uom_code,

mcr.cross_reference AS cross_reference,
mcr.cross_reference_type,
mcr.cross_reference AS customer_part_number,

qll.list_line_id,
qll.list_header_id,
qll.start_date_active,
qll.end_date_active,
qll.operand,
qlht.name AS price_list_name,
qlht.description AS price_list_description,
hca.account_number,
hca.account_name
FROM qp_list_lines qll
LEFT JOIN qp_pricing_attributes qpa
ON qll.list_line_id = qpa.list_line_id
LEFT JOIN mtl_system_items_b msib
ON TO_CHAR(msib.inventory_item_id) = qpa.product_attr_value
LEFT JOIN qp_list_headers_b qlhb
ON qll.list_header_id = qlhb.list_header_id
LEFT JOIN qp_list_headers_tl qlht
ON qll.list_header_id = qlht.list_header_id
LEFT JOIN hz_cust_site_uses_all hcsu
ON qll.list_header_id = hcsu.price_list_id
LEFT JOIN hz_cust_acct_sites_all hcasa
ON hcsu.cust_acct_site_id = hcasa.cust_acct_site_id
LEFT JOIN hz_cust_accounts hca
ON hcasa.cust_account_id = hca.cust_account_id
LEFT JOIN mtl_cross_references mcr
ON mcr.inventory_item_id = msib.inventory_item_id
WHERE qlht.language = 'US'
) x
) y
WHERE y.rn = 1
AND y.start_date_active >= DATE '2023-01-01'
"
]
),

#"Renamed Columns" =
Table.RenameColumns(
Source,
{
{"NEW_OPERAND", "New Price"},
{"OLD_OPERAND", "Old Price"},
{"NEW_END_DATE", "New End Date"},
{"NEW_START_DATE", "New Start Date"},
{"OLD_START_DATE", "Old Start Date"},
{"OLD_END_DATE", "Old End Date"},
{"ORACLE_ITEM", "Oracle Item"}
}
),

#"Sorted Rows" =
Table.Sort(
#"Renamed Columns",
{{"New Start Date", Order.Descending}}
),

#"Changed Type" =
Table.TransformColumnTypes(#"Sorted Rows",{{"ACCOUNT_NUMBER", type any}, {"New Start Date", type date}, {"New End Date", type date}, {"Old Start Date", type date}, {"Old End Date", type date}})

in
#"Changed Type"

 

 

 

 

Here is the error:

Last refresh failed: 5/1/2026, 12:56:48 PM
An error occurred while processing the semantic model.

Data source error:{"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"Oracle: ORA-01013: user requested cancel of current operation"}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ErrorCode","detail":{"type":1,"value":"10478"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourceKind","detail":{"type":1,"value":"Oracle"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourcePath","detail":{"type":1,"value":"Oracle Database"}},{"code":"Microsoft.Data.Mashup.ValueError.ErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ValueError.Message","detail":{"type":1,"value":"ORA-01013: user requested cancel of current operation"}},{"code":"Microsoft.Data.Mashup.ValueError.NativeError","detail":{"type":1,"value":"1013"}},{"code":"Microsoft.Data.Mashup.ValueError.Reason","detail":{"type":1,"value":"DataSource.Error"}}],"exceptionCulprit":1}}}
Cluster URI:WABI-US-EAST2-C-PRIMARY-redirect.analysis.windows.net
Activity ID:d1c8363f-3386-70d0-b025-badb85ab4edc
Request ID:8233336e-e57b-31de-fafc-945a639ba0bc
Time:2026-05-01 17:56:48Z
  • Hi ProblemSolver 

    Error is not due to Power Query steps, it’s an Oracle timeout issue caused by long running query. Steps like sorting or type changes are breaking query folding forcing Power BI to process large data locally which leads to timeout.

    So fix is to push transformations like filters, sorting back to the source which reduce data volume and ensure query folding is maintained so Oracle handles the heavy work instead Power BI

1 Reply

  • Hi ProblemSolver 

    Error is not due to Power Query steps, it’s an Oracle timeout issue caused by long running query. Steps like sorting or type changes are breaking query folding forcing Power BI to process large data locally which leads to timeout.

    So fix is to push transformations like filters, sorting back to the source which reduce data volume and ensure query folding is maintained so Oracle handles the heavy work instead Power BI