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
= Value.NativeQuery(Source, "SELECT DISTINCT
OH.""OHORD#"" AS ""OHORD#"",
OH.OHMTTM AS OHMTTM_1,
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
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?