Forum Discussion
Passing a Date Parameter Through SQL Statement - Refreshing in the Service
- Anonymous7 years ago
Hi,
I decided to split out the Date parameter into 3 separate number parameters, then pass these through the SQL, as follows:
= Sql.Database("SERVER", "DATABASE", [Query="SELECT * FROM [TABLE] WHERE clientParent_ID='"&Number.ToText(#"Client Parent ID")&"' AND weekStartDate>='"&Number.ToText(#"Day (Number)")&"/"&Number.ToText(#"Month (Number)")&"/"&Number.ToText(Year)&"'"])
I scheduled a refresh of this and it worked without any issues.
So now, when someone opens my report, they see the following:
Which then lets then amend the dates for IDs for all queries in the report without having to go into Power Query to do this manually.
Thanks,
MarkJames
Anonymous Hi ,
what does the error message in the service say?
- Anonymous7 years agoNot applicable
Hi ImkeF ,
I've attached an image of the error I get:
This is the last step in the first query of my report. I have attempted a number of refreshes. Eventually the error messges changes to this:
Thanks,
MarkJames
- ImkeF7 years agoCommunity Champion
Hi Anonymous ,
the step "AutoRemovedColumns1" is causing the trouble:
Check out this article how to tackle the problem: https://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
- Anonymous7 years agoNot applicable
Hi ImkeF ,
There's no step in my query called AutoRemovedColumns - could the Power BI Service be introducing this?
Also, if the issue the scheduled refresh not happening because I'm passing a Date parameter through the SQL in the PBIX file, would the technique in the link you've provided even work? I'll still be passing the parameter through a query at the start - splitting out the query would happen after the SQL statement.
MarkJames