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
phillip_from_oz
Frequent Visitor

Power Query Advanced Editor Syntax error

Hi everyone,
I have a syntax error on this code line and I've looked at it many times but I fail to see what is wrong.

 

Can someone please help?

let
source=Csv.Document(File.Contents("c:\temp\01-January.csv"), [Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers"=Table.PromoteHeaders (Source, [PromoteAllScalars=true]),
#"Replaced Value" =Table.ReplaceValue(#"Promoted Headers”, "", null, Replacer.ReplaceValue, {"Month"})
in
Source

The error says "Token comma expected" and it points to the {"Month"} as shown in picture

phillip_from_oz_0-1642582250206.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@phillip_from_oz , when you have used #"Promoted Headers"  , check that double quotes are different on both side. correct it once and try. Check example below

 

let
source=Csv.Document(File.Contents("c:\temp\01-January.csv"), [Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers"=Table.PromoteHeaders (Source, [PromoteAllScalars=true]),
#"Replaced Value" =Table.ReplaceValue(#"Promoted Headers", "", null, Replacer.ReplaceValue, {"Month"})
in
Source

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@phillip_from_oz , when you have used #"Promoted Headers"  , check that double quotes are different on both side. correct it once and try. Check example below

 

let
source=Csv.Document(File.Contents("c:\temp\01-January.csv"), [Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers"=Table.PromoteHeaders (Source, [PromoteAllScalars=true]),
#"Replaced Value" =Table.ReplaceValue(#"Promoted Headers", "", null, Replacer.ReplaceValue, {"Month"})
in
Source

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks.
I must have stared at that code for hours!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors