Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi.
The full error message is:
Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: Incorrect syntax near the keyword 'union'.. '.
Trying to append two queries. See all queries below.
Append – Warranty ratios (BIDW)
let
Source = Table.Combine({#"Installed base - Power and TiLite (BIDW)", #"Warranty ratios (BIDW)"})
in
Source
Installed base – Power and TiLite (BIDW)
let
Source = Sql.Databases("SERVER"),
DATABASE = Source{[Name="DATABASE"]}[Data],
DW_V_InvoiceDetailsUNION = DATABASE{[Schema="DW",Item="V_InvoiceDetailsUNION"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(DW_V_InvoiceDetailsUNION,{"WKInvoiceDate", "WKCustomer", "WKProduct", "IsChair", "SerialNumber"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each ([SerialNumber] <> null and [SerialNumber] <> "" and [SerialNumber] <> "NA") and ([IsChair] = 1)),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"WKInvoiceDate", Order.Ascending}})
in
#"Sorted Rows"
Warranty ratios (BIDW)
let
Source = Sql.Databases("SERVER"),
DATABASE = Source{[Name="DATABASE"]}[Data],
DW_V_InvoiceDetailsUNION = DATABASE{[Schema="DW",Item="V_InvoiceDetailsUNION"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(DW_V_InvoiceDetailsUNION,{"WKInvoiceDate", "WKCompany", "WKCustomer", "WKProduct", "WKOrderCategory", "SerialNumber", "NetAmount", "CostAmount", "OrderQuantity"}),
#"Filtered Rows1" = Table.SelectRows(#"Removed Other Columns", each ([SerialNumber] <> null and [SerialNumber] <> "" and [SerialNumber] <> "NA") and ([WKOrderCategory] = 6)),
#"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [WKInvoiceDate] >= #date(2015, 1, 1))
in
#"Filtered Rows2"
Solved! Go to Solution.
Hi.
Thanks. I found another solution, in another topic. I removed the sorting from one of the underlying queries -then the problem disappeared.
It seems both of the queries you want to append are from the same table in the same database. And I think your queries are good and I don't see any error.
Where do you use the Power Query Editor? In Power BI Desktop, Excel or Dataflow? If you are using Power BI Desktop, can you update it to the latest version and try the append operation again?
If updating the version of the application doesn't solve this problem, you could consider removing the applied steps one by one from the last step to check whether some specific transformation step caused this error.
You could also first connect to the same table in both queries and append the queries before any transformation to check whether they can be appended. If there is no error, then add the proceeding steps to transform the queries. If you find a step would cause this error, remove it and think about adding it in the appended query.
Hope this helps.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi.
Thanks. I found another solution, in another topic. I removed the sorting from one of the underlying queries -then the problem disappeared.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |