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
hello,
I'm new to coding in Power Query.
I tried adding the last line #"Padded Values" to the existing code but I am getting the Token Comma expected error.
Can someone please explain why?
Thank you
let
Source = Excel.Workbook(File.Contents(XLS), null, true),
Areas_Sheet = Source{[Item="Areas",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Areas_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"AreaScheme", type text}, {"Level", type text}, {"Number", type text}, {"Name", type text}, {"Area", type number}, {"CTA.ZoneCode", type text}}),
#"Inserted Last Characters" = Table.AddColumn(#"Changed Type", "Last Characters", each Text.End([Level], 2), type text),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Last Characters",{{"Last Characters", "LevelPrefix"}})
#"Padded Values" = Text.PadStart(#"Padded Values",[Level Prefix],5,"0")
in
#"Padded Values"
Solved! Go to Solution.
All steps except the last need a comma after them. Add a comma at the end of your #"Renamed Columns" step.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
HI I am new to coding in Power Query. I am
I am getting the Token Comma expected error.
Can someone please explain why?
Thank you
let bernDistAna = (hitNum) => {
let p = sum(hitNum)/count(hitNum);
return hitNum * (1 - p);
};
Your last step is referencing itself (so that variable doesn't exist yet). Change it to reference your previous step.
#"Padded Values" = Text.PadStart(#"Renamed Columns",[Level Prefix],5,"0")
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thank you @mahoneypat
But now I am getting the following error.
Expression.Error: The name 'Padded Values' wasn't recognized. Make sure it's spelled correctly.
All steps except the last need a comma after them. Add a comma at the end of your #"Renamed Columns" step.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |