Forum Discussion

Niraj's avatar
Niraj
New Member
6 years ago

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

  • 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"