I think I'm missing the obvious so would appreciate alittle help.
I'm using the following parameter:
dMonths
tFact
My columns headers include the End of Month Date, which is why I'm using this (I also have one for Year End)
The following allows me to append the string:
But I can't use this within List.Sum when grouping:
The error is highlighted, "Invalid identifier"
I'm using the following parameter:
Excel 2010 | |||||
---|---|---|---|---|---|
A | B | C | |||
3 | Filter | Date | |||
4 | Month End | 31/07/2016 | |||
_control |
dMonths
Rich (BB code):
(myParameter) =>
let
Source = Excel.CurrentWorkbook(){[Name="dMonths"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Filter", type text}, {"Date", type datetime}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Filter] = myParameter)),
ReturnParam = Record.Field(#"Filtered Rows"{0}, "Date")
in
ReturnParam
tFact
Rich (BB code):
MonthEnd = Date.ToText(Date.From(dMonths("Month End")),"dd-MMM-yy"),
My columns headers include the End of Month Date, which is why I'm using this (I also have one for Year End)
The following allows me to append the string:
Rich (BB code):
#"Removed Other Columns" = Table.SelectColumns(#"Promoted Headers",{"Description", "Plan #(lf)Month ending #(lf)"&MonthEnd, "Actual #(lf)Month ending #(lf)"&MonthEnd, "Variance #(lf)Month ending #(lf)"&MonthEnd, "Plan #(lf)YTD ending #(lf)"&MonthEnd, "Actual #(lf)YTD ending #(lf)"&MonthEnd, "Variance #(lf)YTD ending #(lf)"&MonthEnd, "Plan #(lf)Year ending #(lf)"&YearEnd, "Simple Forecast Year ending#(lf)"&YearEnd, "Forecast Adjustment Year ending#(lf)"&YearEnd, "Adjusted Forecast #(lf)Year ending#(lf)"&YearEnd, "Forecast Variance #(lf)Year ending#(lf)"&YearEnd}),
But I can't use this within List.Sum when grouping:
Rich (BB code):
#"Grouped Rows" = Table.Group(#"Filtered Rows2", {"NewColumn.Sort Order", "NewColumn.Sub Total Heading", "NewColumn.Internal Reporting Header"}, {{"Plan This Month", each List.Sum([#"Plan #(lf)Month ending #(lf)"&MonthEnd]), type number}, {"Actual This Month", each List.Sum([#"Actual #(lf)Month ending #(lf)31-Jul-16"]), type number}, {"Var This Month", each List.Sum([#"Variance #(lf)Month ending #(lf)31-Jul-16"]), type number}, {"Plan YTD", each List.Sum([#"Plan #(lf)YTD ending #(lf)31-Jul-16"]), type number}, {"Actual YTD", each List.Sum([#"Actual #(lf)YTD ending #(lf)31-Jul-16"]), type number}, {"Var YTD", each List.Sum([#"Variance #(lf)YTD ending #(lf)31-Jul-16"]), type number}, {"Annual Plan", each List.Sum([#"Plan #(lf)Year ending #(lf)31-Mar-17"]), type number}, {"Simple Forecast", each List.Sum([#"Simple Forecast Year ending#(lf)31-Mar-17"]), type number}, {"Forecast Adjustment", each List.Sum([#"Forecast Adjustment Year ending#(lf)31-Mar-17"]), type number}, {"Adjusted Forecast", each List.Sum([#"Adjusted Forecast #(lf)Year ending#(lf)31-Mar-17"]), type number}, {"Forecast Var", each List.Sum([#"Forecast Variance #(lf)Year ending#(lf)31-Mar-17"]), type number}}),
The error is highlighted, "Invalid identifier"