Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
Is this possible to set up Incremental refrsh on the Redshift Views in Power BI?
Could you please share the approach and sample code if possible. We have 13 million records in few fact tables and Instead of full refresh of the semantic model on daily basis, we want to load the data into semantice model in incermental appraoch.
Thanks,
Srinivas.
Solved! Go to Solution.
Hello @Koritala,
Thank you for your feedback. Below is a revised M-code for your Redshift table, using standard SQL with CAST for timestamp compatibility to support incremental refresh and query folding.
let Source = Sql.Database("redshift-server", "database", [Query="SELECT * FROM FactSales WHERE LastUpdatedDate >= CAST('" & DateTime.ToText(RangeStart, "yyyy-mm-dd hh:nn:ss") & "' AS TIMESTAMP) AND LastUpdatedDate < CAST('" & DateTime.ToText(RangeEnd, "yyyy-mm-dd hh:nn:ss") & "' AS TIMESTAMP)"]) in Source
Check RangeStart and RangeEnd are Date/Time parameters, and update "redshift-server", "database", FactSales, and LastUpdatedDate to your setup. Please share the error details, table structure, or specific Redshift functions you’d like to use, so I can refine the solution.
If the response answered your query, kindly “Accept as Solution” and Give “Kudos” to help others in the community benefit from it as well.
Thank you.
Hi @Koritala,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi, your M code is not working. I think we should use redshift specific functions to work.
Hello @Koritala,
Thank you for your feedback. Below is a revised M-code for your Redshift table, using standard SQL with CAST for timestamp compatibility to support incremental refresh and query folding.
let Source = Sql.Database("redshift-server", "database", [Query="SELECT * FROM FactSales WHERE LastUpdatedDate >= CAST('" & DateTime.ToText(RangeStart, "yyyy-mm-dd hh:nn:ss") & "' AS TIMESTAMP) AND LastUpdatedDate < CAST('" & DateTime.ToText(RangeEnd, "yyyy-mm-dd hh:nn:ss") & "' AS TIMESTAMP)"]) in Source
Check RangeStart and RangeEnd are Date/Time parameters, and update "redshift-server", "database", FactSales, and LastUpdatedDate to your setup. Please share the error details, table structure, or specific Redshift functions you’d like to use, so I can refine the solution.
If the response answered your query, kindly “Accept as Solution” and Give “Kudos” to help others in the community benefit from it as well.
Thank you.
Hi @Koritala,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.
Hi @Koritala,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Koritala,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi, query folding is not enabling. May I know that is mandatory for any databasse?
Hello @Koritala,
Thank you for followup query.
Query folding is not strictly mandatory for incremental refresh in Power BI with any database, including Amazon Redshift, but it’s highly recommended for performance. Query folding allows Power BI to push filtering logic (e.g: based on the date/time column in your Redshift view) to the database, reducing the amount of data transferred and speeding up refreshes, especially for large datasets like your 13 million record fact tables. If query folding isn’t enabled, Power BI processes the filters locally, which can slow down the refresh process.
Since you mentioned query folding isn’t enabling, it’s likely due to a complex view definition (e.g: joins, window functions, or unsupported SQL elements). You can still use incremental refresh without query folding, but performance may be suboptimal.
If this helps, please “Accept as solution” and give a “kudos” to assist other community members.
Thank you.
Hi Sriganesh,
Thanks for your reply.
Can you plz share M-code format to pass the dynamic parameters to filter the data before loading into power bi with custom sql for redshift table?
Thanks,
Srinivas.
Hi @Koritala,
Below is an example of M-code to pass dynamic RangeStart and RangeEnd parameters in a custom SQL query for a Redshift table in Power BI. This filters the data based on a date/time column (e.g: LastUpdatedDate) before loading, which can help with incremental refresh and query folding.
let Source = Sql.Database("redshift-server", "database", [Query="SELECT * FROM FactSales WHERE LastUpdatedDate >= '" & DateTime.ToText(RangeStart, "yyyy-mm-dd hh:nn:ss") & "' AND LastUpdatedDate < '" & DateTime.ToText(RangeEnd, "yyyy-mm-dd hh:nn:ss") & "'"]) in Source
Ensure RangeStart and RangeEnd parameters are defined in Power Query with the Date/Time type. Replace "redshift-server", "database", and FactSales with your actual Redshift server, database, and table names, and adjust LastUpdatedDate to match your date/time column. This query should support query folding, but you can verify by checking if “View Native Query” is enabled in Power Query Editor.
I trust this addresses your needs. If it does, please “Accept as solution” and give it a "kudos" to help others find it easily.
Thank you.
Hello @Koritala,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Yes, you can set up incremental refresh in Power BI on Amazon Redshift views, provided the view supports query folding (so that Power BI can push date-based filters to Redshift).
If needed, consider using a table or materialized view in Redshift for better support of incremental refresh.
Thank you, @andrewsommer for sharing valuable insights.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Incremental Refresh on Amazon Redshift Views in Power BI is not natively supported
Please mark this post as a solution if it helps you. Appreciate Kudos.
Hi Andrewsommer,
Thanks for your response and is there any alternate to achive the incremental refresh in my case.
Thanks,
Koritala
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!