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
Surjeet
New Member

PowerBI EnableFolding

I'm trying to GET data from POSTGRES Server using Direct Query and pasting SQL query in Advanced option but its giving error :'

 

Details: "We cannot fold on top of this native query. Please modify the native query or remove the 'EnableFolding' option."

 

I dont understand where 

1 ACCEPTED SOLUTION

Hi @Surjeet ,

 

To disable native query folding, set the EnableFolding flag to false for Value.NativeQuery() in the advanced editor.

Vlianlmsft_0-1623999018722.pngVlianlmsft_1-1623999063987.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
pollyboy
New Member

If you remove the; semi-colon at the end of your query. It works perfectly. 

Surjeet
New Member

Hello Denis,

 

Thank You for your reply. May I know where exactly I have to make changes. I have seen this solution befor but could not find where exactly location this change has to be done. 

 

If during GEt DATA option in SQL statement I have to mention something?

Hi @Surjeet ,

 

To disable native query folding, set the EnableFolding flag to false for Value.NativeQuery() in the advanced editor.

Vlianlmsft_0-1623999018722.pngVlianlmsft_1-1623999063987.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @Surjeet ,

 

that's a common error for Postgres databases. The reason is that Power BI is adding a query folding by default.

Search for the error message and you will get a lot of similar topics.

 

However, since a while there is an option to turn the folding off:

Value.NativeQuery(target as any, query, null, [EnableFolding=false])

Check the documentation about that:

Power Query PostgreSQL connector | Microsoft Docs

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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.