Forum Discussion
RobertSlattery
Responsive Resident
9 years agoEvaluate my Data Model/Table Structure!
Expression.Evaluate environment breaks visual I have a function that operates on tables with similar names, it works fine in the preview in the Edit Query window but throws an error in the visual...
- 9 years ago
I’ve got response from the Product Team.
This is effectively "by design" and will not be changed.
Best Regards,
Herbert
Anonymous
9 years agoNot applicable
Please check if the following code works in your scenario. If not, please post sample data of your table.
let
export = (baseName as text, fy as list) =>
let
ret = List.Transform(fy, each
let
name = "#" & """" & Text.Replace(baseName, "$", Text.From(_)) & """",
t = Expression.Evaluate("name", [name=name]),
year = _
in
Table.AddColumn(t, "FY", each year)
)
in
ret
in
export
// Table.Combine(addFY("Invoice_Summary FY to $", {2012,2013,2014,2015,2016,2017}))
Reference:
https://blog.crossjoin.co.uk/2015/02/06/expression-evaluate-in-power-querym/
Regards,
Lydia
RobertSlattery
Responsive Resident
9 years agoHi Lydia, were you able to use the minimum example I posted and repro the problem?
Because it works in the query editor preview (i.e. the query runs correctly) and not in the visual it seems like this is a bug perhaps?
Anonymous