Forum Discussion

Koritala's avatar
Koritala
Post Patron
1 year ago
Solved

Incremental Refresh With Redshift Views In Power BI

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 t...
  • v-ssriganesh's avatar
    v-ssriganesh
    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 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.