Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I've a model data made with Import Connectivity.
I've been tasked to convert it to DirectQuery and in several table they are all done with CTE.
I have a CTE SQL Query
That
When I click "Close and Apply" in PowerQuery I do receive this error
Hi f_e_user,
You need to start With CTE query with a Semicolon ";"
So it should be like ; With CTE
Just add a semicolon before your CTE expression will solve
Hope this helps
https://stackoverflow.com/a/64217559/11156131
You can call each of the query tables seprately, create dat amodel, create measures and have it report exactly like the SQL above
Hi @f_e_user, I think that you are only missing a ";". Try the following:
WITH NewestOS AS (
SELECT GS_OS_Data.ResourceID
, TimeStamp
, Caption0
FROM v_GS_Operating_System as GS_OS_Data
INNER JOIN (SELECT ResourceID
, MAX(TimeStamp) as MaxDate
FROM v_GS_Operating_System
GROUP BY ResourceID
) MaxFilter on GS_OS_Data.ResourceID = MaxFilter.ResourceID and MaxFilter.MaxDate = GS_OS_Data.TimeStamp
);
SELECT v_R_System.ResourceID
, v_R_System.Name0
, v_R_System.Name0 + '.' + v_R_System.Full_Domain_Name0 as Resource_Names0
, v_R_System.Resource_Domain_OR_Workgr0 AS 'DOMAIN'
, CASE v_R_System.Client0
WHEN 1 THEN 'INSTALLED'
ELSE 'MISSING'
END AS ClientStatus
, v_R_System.Client_Version0
, v_R_System.Last_Logon_Timestamp0
, CASE NewestOS.Caption0
WHEN NULL THEN v_R_System.Operating_System_Name_and0
ELSE NewestOS.Caption0
END AS OSNAME
, V_GS_System.SystemRole0
FROM v_R_System
LEFT OUTER JOIN NewestOS on v_R_System.ResourceID = NewestOS.ResourceID
LEFT OUTER JOIN v_GS_System ON v_R_System.ResourceID = v_GS_System.ResourceID
WHERE v_R_System.Operating_System_Name_and0 LIKE '%Microsoft%'
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
It didn't solve the issue.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 64 | |
| 58 | |
| 31 | |
| 25 | |
| 25 |