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.
I keep getting the error "token tof expected" when I add any code after the folowing block:
let
Source = Excel.Workbook(File.Contents("C:\Data Source.xlsx"), null, true),
#"Summary by Prov_Yr_Sheet" = Source{[Item="Summary by Prov_Yr",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Summary by Prov_Yr_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"eg 1", type text}, {"eg 2", type text}, {"eg 3", Int64.Type}, {"Indications", type text}, {"eg 4", type text}, {"In any data? #(lf)(Y/N)", type text}, {"Year", type date}, {"Province", type text}, {"Source", type text}, {"Total, max-adj", type number}})
in
#"Changed Type"
I keep getting the error regardless of adding a comma after the above code. It's odd since this is the auto-generated code for importing the data. The code I've been trying to add is:
Beginning Value = calculate(sum('Summary by Prov_Yr'[Total, max-adj]),filter('Summary by Prov_Yr','Summary by Prov_Yr'[Year]=min('Summary by Prov_Yr'[Year]))),
Ending Value = calculate(sum('Summary by Prov_Yr'[Total, max-adj]),filter('Summary by Prov_Yr','Summary by Prov_Yr'[Year]=max('Summary by Prov_Yr'[Year]))),
# of Years = (max('Summary by Prov_Yr'[Year])-MIN('Summary by Prov_Yr'[Year])),
CAGR_T = iferror( ([Ending Value]/[Beginning Value])^(1/[# of Years])-1 , 0)
Solved! Go to Solution.
This error message means you should add a comma after each step except the last step, so please check this after you add new steps in advanced editor.
In addtion, the second part is dax code which can't be added in advanced editor. You should input power query(M code) in advanced editor, not dax code.
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This error message means you should add a comma after each step except the last step, so please check this after you add new steps in advanced editor.
In addtion, the second part is dax code which can't be added in advanced editor. You should input power query(M code) in advanced editor, not dax code.
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |