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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
SBIM
Helper I
Helper I

Enabling Query Folding on Native Query

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]

 

SBIM_0-1673444173675.png

 

Am I doing something wrong or is query folding not going to be an option here?

1 REPLY 1
edhans
Community Champion
Community Champion

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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.