Forum Discussion
Service errors messages not seen when refreshing PBIX
I have created a date parameter and want to pass it into the SQL query part of my query. This seems to work absolutely fine refreshing the PBIX, but when I publish getting all sorts of horrible error messages such as below. all metion references to other queries.
Below is an example of the code I'm using to pull in the parameter "Loaddate"
let
Source = Sql.Database("ACFT-VMDB-P33.apiia.ukfast", "master", [Query="
SELECT 'Amex' AS [Client],
[FailedContactID] AS ParkedCallID,
ActionedByAdviserID AS AdviserID,
ActionedDateTime AS CallReturnedDT
FROM [Amey_DW_REPORTING].[dbo].[Fact_Cases_FailedContacts]
WHERE ContactType = 1 AND ActionedDateTime IS NOT NULL
AND ActionedDateTime >='" & DateTime.ToText(Loaddate,"yyyyMMdd HH:mm") & "'
"]),
#"Appended Query" = Table.Combine({Source, #"ParkedCalls Returned P22"}),
#"Extracted Date" = Table.TransformColumns(#"Appended Query",{{"CallReturnedDT", DateTime.Date, type date}})
in
#"Extracted Date"
Is there some reason why the service can't understand this query whereas PBIX can? Is there some other syntax that will allow me to use a power query parameter within the SQL query without it blowing up?
I appreciate I could add the parameter in a power Query filter AFTER the SQL SELECT, but this seems super inefficient as will oad the whole table and then throw a load of it away.
Appreicate any advice
Mike
Hi masplin ,
Please refer to this article:
https://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
Best Regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- nickyvvMost Valuable ProfessionalJust a quick message, I think you shouldn't leave your server names in the code out here in public. Please leave them out or replace them with a blank or SERVER value
- masplinImpactful Individual
They are not real I changed them. Thanks anyway
- v-lionel-msftCommunity Support
Hi masplin ,
Please refer to this article:
https://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
Best Regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- masplinImpactful Individual
Hi Lionel. So if this is the issue why does it work in PBIX, but not on the server?
Also the code here is identical to what was written by another consultant that works fine except I added the date parameter.
- v-lionel-msftCommunity Support
Hi masplin ,
I'm sorry I can't find the issue reason.Please Create support ticket .
Best Regards,
Lionel Chen