Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
I am trying to connect Power BI with SQL query with Direct import query wherein it works fine in SQL and power editor but after proceeding with "Load" the below error occurs. I am looking for the solution for past 2 weeks. Can anyone assist me.
Error :
Microsoft SQL: Incorrect syntax near the keyword 'with'. Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. Incorrect syntax near ')'.
Hello @Revathi_Kannan ,
This is a MS SQL Server error message.
Start the WITh SQL statement (Common Table Expression) by adding a semicolon before it:
like below:
;WITH
| User | Count |
|---|---|
| 22 | |
| 20 | |
| 20 | |
| 19 | |
| 11 |
| User | Count |
|---|---|
| 62 | |
| 55 | |
| 46 | |
| 45 | |
| 34 |