Forum Discussion
Incremental Refresh With Redshift Views In Power BI
- 1 year ago
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 SourceCheck 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.
- v-ssriganesh1 year agoCommunity Support
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 SourceCheck 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.- v-ssriganesh1 year agoCommunity Support
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.