Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
@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
@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
Thanks.
I must have stared at that code for hours!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 152 | |
| 130 | |
| 109 | |
| 79 | |
| 54 |