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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Niraj
New Member

Token Comma expected

Hi all. This is my first post so I'm hoping to get this right. 

 

I'm getting the following error of Token Comma expected. I go to show error and it highlights the piece and I insert a comma before it but this doesn't solve it. Please help. Just want to add last refresh data to a PowerBI report.

 

let
Source = Excel.Workbook(Web.Contents("https://"), null, true),
#"LR project details_Sheet" = Source{[Item="LR project details",Kind="Sheet"]}[Data],
#"Removed Top Rows" = Table.Skip(#"LR project details_Sheet",1),
#"Promoted Headers1" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers1",{{"Remark/Note", type text}, {"Status #(lf)June 20", type text}, {"Status #(lf)May 20", type text}, {"Status #(lf)April 20", type text}, {"Status #(lf)March 20", type text}, {"Status #(lf)February 20", type text}, {"Status #(lf)January 20", type text}, {"Status #(lf)December 19", type text}, {"Status #(lf)November 19", type text}, {"Status #(lf)October 19", type text}, {"Status #(lf)September 19", type text}, {"Status #(lf)August 19", type text}, {"Status #(lf)July 19", type text}, {"Changes occurred from last month", type text}, {"Anticipated key deliverables for next month ", type text}, {"What key deliverables were achieved this month?", type text}, {"Project Benefit", type text}, {"Major stakeholders", type text}, {"Emerging risks", type text}, {"Interdependencies ", type text}, {"Key Problems and Issues", type text}, {"Total days", Int64.Type}, {"Finish date", type date}, {"Due date", type date}, {"Start date", type date}, {"Overall expenditure to date", Currency.Type}, {"Overall budget", Currency.Type}, {"About funding", type text}, {"AC Business Alignment 2", type text}, {"Business Plan Alignment", type text}, {"Links to AC Business plan", type text}, {"Project Priority", type text}, {"Project Type", type text}, {"Team", type text}, {"Project manager/officer", type text}, {"ACT Parent Program", type text}, {"Project description", type text}, {"Project Name", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"Status #(lf)July 19", "Status #(lf)August 19", "Status #(lf)September 19", "Status #(lf)October 19", "Status #(lf)November 19", "Status #(lf)December 19", "Status #(lf)January 20", "Status #(lf)February 20", "Status #(lf)March 20", "Status #(lf)April 20", "Status #(lf)May 20", "Status #(lf)June 20"}, "Attribute", "Value"),
#"Replaced Value" = Table.ReplaceValue(#"Unpivoted Only Selected Columns","Status","",Replacer.ReplaceText,{"Attribute", "Value"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Attribute", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Attribute", "Month of Status"}, {"Value", "Status"}})
#"{tableid}_Table" = Source{[Id="{tableid}",Kind="Table"]}[Data],
#"Added Refresh Date" = Table.AddColumn(#"{tableid}_Table", "Refresh Date",
each DateTimeZone.FixedUtcNow(), as datetimezone)
in
#"Renamed Columns"
#"Added Refresh Date"

1 REPLY 1

@Niraj 

You may try this:

let
Source = Excel.Workbook(Web.Contents("https://"), null, true),
#"LR project details_Sheet" = Source{[Item="LR project details",Kind="Sheet"]}[Data],
#"Removed Top Rows" = Table.Skip(#"LR project details_Sheet",1),
#"Promoted Headers1" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers1",{{"Remark/Note", type text}, {"Status #(lf)June 20", type text}, {"Status #(lf)May 20", type text}, {"Status #(lf)April 20", type text}, {"Status #(lf)March 20", type text}, {"Status #(lf)February 20", type text}, {"Status #(lf)January 20", type text}, {"Status #(lf)December 19", type text}, {"Status #(lf)November 19", type text}, {"Status #(lf)October 19", type text}, {"Status #(lf)September 19", type text}, {"Status #(lf)August 19", type text}, {"Status #(lf)July 19", type text}, {"Changes occurred from last month", type text}, {"Anticipated key deliverables for next month ", type text}, {"What key deliverables were achieved this month?", type text}, {"Project Benefit", type text}, {"Major stakeholders", type text}, {"Emerging risks", type text}, {"Interdependencies ", type text}, {"Key Problems and Issues", type text}, {"Total days", Int64.Type}, {"Finish date", type date}, {"Due date", type date}, {"Start date", type date}, {"Overall expenditure to date", Currency.Type}, {"Overall budget", Currency.Type}, {"About funding", type text}, {"AC Business Alignment 2", type text}, {"Business Plan Alignment", type text}, {"Links to AC Business plan", type text}, {"Project Priority", type text}, {"Project Type", type text}, {"Team", type text}, {"Project manager/officer", type text}, {"ACT Parent Program", type text}, {"Project description", type text}, {"Project Name", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"Status #(lf)July 19", "Status #(lf)August 19", "Status #(lf)September 19", "Status #(lf)October 19", "Status #(lf)November 19", "Status #(lf)December 19", "Status #(lf)January 20", "Status #(lf)February 20", "Status #(lf)March 20", "Status #(lf)April 20", "Status #(lf)May 20", "Status #(lf)June 20"}, "Attribute", "Value"),
#"Replaced Value" = Table.ReplaceValue(#"Unpivoted Only Selected Columns","Status","",Replacer.ReplaceText,{"Attribute", "Value"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Attribute", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Attribute", "Month of Status"}, {"Value", "Status"}}),
#"{tableid}_Table" = Source{[Id="{tableid}",Kind="Table"]}[Data],
#"Added Refresh Date" = Table.AddColumn(#"{tableid}_Table", "Refresh Date",
each DateTimeZone.FixedUtcNow(), as datetimezone)
in
#"Renamed Columns"
#"Added Refresh Date"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.