This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I am trying to setup an incremental refresh but I am having trouble with the query folding. My connection is via an ODBC driver and I am connecting to an AS400 system. I can run queries against it fine, but I am getting the warning the M query may not support folding. I checked on the very first step and View Native Query was greyed out which is suppose to mean it does not support folding. So I have tried to follow some guides on how to enable it via a custom step in the Power Query Editor
e.g.
= Value.NativeQuery(Source, "SELECT DISTINCT
OH.OHOTYP,
OHORDD,
OHENTD,
OH.""OHORD#"" AS ""OHORD#"",
OH.OHMTTM,
OH.OHCRQM,
OHREQD,
OH.OHINIT,
OH.OHDTMT,
OH.OHMTTM AS OHMTTM_1,
OH.OHMUSR,
OHP.OHCORD
FROM
IASP1.FRNDTA031.OH OH,
IASP1.FRNDTA031.O6 O6,
IASP1.FRNDTA031.CM1 CM1,
IASP1.FRNDTA031.O4 O4,
IASP1.FRNDTA031.OHP OHP
WHERE
OH.""OHORD#"" = O6.""O6ORD#""
AND OH.OHBTKY = CM1.C1STKY
AND OH.""OHORD#"" = O4.""O4ORD#""
AND OH.OHDRC = OHP.OHDRC
AND OH.""OHORD#"" = OHP.""OHORD#""
AND OH.OHLSUF = OHP.OHLSUF
AND (( OH.OHBTKY <> '007279'
AND OH.""OHORD#"" > 0))
AND OH.OHOTYP = 'SI'
AND OHP.OHCORD < 0
ORDER BY
5 DESC", null, [EnableFolding = true])
But I am getting the error Native queries are not supported by this value. Details: [Table]
Am I doing something wrong or is query folding not going to be an option here?
Initially Value.NativeQuery only worked with PostGRE SQL, then SQL Server as well. More are being added - cannot find a good list - but pretty sure AS/400 via ODBC is not yet on that list unfortunately.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCheck out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.