Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have a problem with keeping query folding in my query when merging three datasets into one. I'm using Odbc.DataSource, and everything works fine until the filtering part, where I want to use RangeStart and RangeEnd parameters to enable incremental refresh. For the column and parameters, I'm using the DateTime type in Power Query and timestamp in PostgreSQL.
I noticed that after applying any filter in Power Query, the "View Native Query" option becomes greyed out. This makes me think it could be related to the way I'm retrieving data.
Solved! Go to Solution.
Hi @kamilos01 -Yes, the issue you're facing is most likely due to query folding breaking when you apply a filter using RangeStart and RangeEnd in Power Query.
as checked the steps, bfore merging, apply the date filter as early as possible.This ensures filtering happens before merging.If the View Native Query option remains greyed out, then filtering is happening locally. in someways, Instead of merging in Power Query, try joining tables in PostgreSQL first and then importing the result.
Hope the above information helps.
Proud to be a Super User! | |
Hi @rajendraongole1
Thanks for your suggestions. Yes, I was trying to filter out as early as possible (including other columns), but always "View native query" was greyed out.
Initially I wanted to use join in my postgresql DB earlier, but simple table was too big to get it and I always got an error.
Hi @kamilos01
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions. If the issue has been resolved, we kindly request you to share the resolution or key insights here to help others in the community. If we don’t hear back, we’ll go ahead and close this thread.
Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.
Thank you for your understanding and participation.
Best Regards,
Cheri Srikanth
Hi @kamilos01
We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please accept as solution to help others benefit.
Thank you.
Hi @kamilos01
As highlighted by @rohit1991 and @rajendraongole1 , the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.
If the above information helps you, please give us a Kudos and marked the reply Accept as a Solution.
Thanks,
Cheri Srikanth.
hi @kamilos01 ,
This is a classic issue with Power BI and ODBC sources like PostgreSQL query folding breaks when Power Query can’t push your filter step down to the database, so it processes everything locally (which is way slower).
Here’s what you can do:
Filter as early as possible: Always place your RangeStart/RangeEnd (or any filter) as the first steps in your query before merges or transformations. This gives Power Query the best shot at folding.
Check your data types: Make sure both your parameter and the column in PostgreSQL are the same data type (ideally timestamp). Even a small mismatch will break folding.
Avoid anything that blocks folding: Steps like Table.Buffer or complex calculated columns can stop folding dead in its tracks. Keep things simple up to your filter step.
Try a native SQL query: If folding just won’t work, use a native SQL query inside Power Query (Home > Advanced Editor).
Hi @rohit1991,
Thanks for your suggestions. Unfortunately the last one is the right one.
Just after uploading the table, I tried to filter any column (text, numeric, date) but always the "View native query" field got greyed out 😞 Also using select doesn't work.
I'm not using the Table.Buffer function.
Maybe using native postgresql is an option.
Hi @kamilos01 -Yes, the issue you're facing is most likely due to query folding breaking when you apply a filter using RangeStart and RangeEnd in Power Query.
as checked the steps, bfore merging, apply the date filter as early as possible.This ensures filtering happens before merging.If the View Native Query option remains greyed out, then filtering is happening locally. in someways, Instead of merging in Power Query, try joining tables in PostgreSQL first and then importing the result.
Hope the above information helps.
Proud to be a Super User! | |
Hi @rajendraongole1
Thanks for your suggestions. Yes, I was trying to filter out as early as possible (including other columns), but always "View native query" was greyed out.
Initially I wanted to use join in my postgresql DB earlier, but simple table was too big to get it and I always got an error.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 18 | |
| 11 | |
| 11 | |
| 10 |