Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kwandike
New Member

Power Query to Power BI migration syntax issues

Hey!

I have this code wich works totally fine in Power Query but brags in Power BI.

 

I mean it works with some simple code like SELECT name FROM groups.name, but it fails when using some more difficult forms like G."name" "groups.name" etc.

 

Instead it throws an error "Token comma expected" (see screen capture below).

 

I do assume that there's some syntax hints but I wasn't able to QA them with try'n'fail strategy.


Appreciate your help and efforts.

 

let
	  Source = PostgreSQL.Database("server-hidden-for-a-reason", "server-hidden", 
	    [Query="SELECT
        
        G."name" "groups.name",
	T."fullName" "teachers.fullName",
        LR."createdAt"::date "lessonrecords.createdAt.date",
	LR."createdAt"::time "lessonrecords.createdAt.time",
	LR.private "lessonrecords.private",
	LC."name" "lessoncards.name",
	LC."category" "lessoncards.category",
	LR.status "lessonrecords.status",
        LR.id "lessonrecords.id",
        LR."groupId" "lessonrecords.groupId",
        LR."authorId" "lessonrecords.authorId",
        LR."lessonId" "lessonrecords.lessonId",
	length(LR.note) "length_of_a_note",
	(SELECT COUNT(*) FROM public.lessonrecordphotos WHERE "lessonrecordId" = LR.id) "N_of _Photos_In_A_Record",
	(SELECT COUNT(*) FROM public.lessonrecordparticipants WHERE "lessonrecordId" = LR.id) "N_of_Participants_In_A_Record"
FROM public.lessonrecords LR
  INNER JOIN public.teachers T ON (LR."authorId" = T.id)
  LEFT JOIN public.lessoncards LC ON (LR."lessonId" = LC.id)
  INNER JOIN public.groups G ON (LR."groupId" = G.id);"])
	
in
	  Source

PowerBIQuery.png

3 REPLIES 3
Kwandike
New Member

Any1 pls?

Anonymous
Not applicable

@Kwandike,

When you click "Show errors" after Token comma expected, which syntax Power BI Desktop leads you to?

Regards,
Lydia

Hi @Anonymous,

It starts at G."name" (it's highlighted blue on the print screen)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.