Forum Discussion

ldwf's avatar
ldwf
Icon for Helper V rankHelper V
1 year ago

Date Parameters for Incremental Refresh not working

I am trying to do incremental refresh.  I set up my RangeStart and RangeEnd parameters but when I select Incremental Refresh, I get the message that I need to set up my parameters.  I'm connecting to SQL Server, and the field is defined as datetime in the database, and when I create the parameters I define them as date/time, so I don't know what the issue is.  Do I need to change the format in the SQL statement when extracting the field?  I've attached a screenshot of the error message and a screenshot showing the format of the parameters.

 

3 Replies

  • Hi ldwf - 

    It looks like you've set up the RangeStart and RangeEnd parameters correctly in the Power BI "Manage Parameters" dialog, with the data type set to Date/Time. However, if you’re seeing an error message stating that you need to set up your parameters when trying to enable incremental refresh, here are a few potential solutions:

    Parameter Names: Ensure that the parameter names are exactly RangeStart and RangeEnd, as Power BI is case-sensitive with incremental refresh parameters. Minor differences in spelling or case can cause issues.

    Parameter Usage in Filter: Check that the parameters are actively being used to filter the data in your SQL query or Power Query M code. In Power Query, you should add a filter on the date column in your SQL table, referencing RangeStart and RangeEnd like this

    Table.SelectRows(Source, each [YourDateColumn] >= RangeStart and [YourDateColumn] < RangeEnd)

     

    Replace [YourDateColumn] with the name of your date column. This step is essential for Power BI to recognize that the parameters are being used for filtering.

    Data Type Consistency: Since you’re using SQL Server and have set the parameters to Date/Time, verify that the column in SQL Server is also DateTime. Any mismatch in data type (e.g., if the SQL column is Date only) could prevent Power BI from recognizing the parameter usage.

    Apply All Changes: Sometimes, Power BI may not immediately recognize the parameter configuration until all changes are applied. Ensure you’ve loaded the data after creating the parameters and applying the date filter.

     

    Hope this information helps.

    • ldwf's avatar
      ldwf
      Icon for Helper V rankHelper V

      I validated everything, and am now getting the message in the first screenshot below.  

      My understanding is that this may be due to the fact that this query is using custom SQL to extract the data from SQL Server.  See screenshot.  Can I do incremental refresh/query folding if I use custom SQL to extract the data?: