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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors