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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JVos
Helper IV
Helper IV

Expression.Evaluate code does not work because of unknown identifier

Why does below code not work, and raise an error ("Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?") caused by the Expression.Evaluate part?

 

 

let
    TableA = Excel.CurrentWorkbook(){[Name="tblRoute"]}[Content],
    TableB = Excel.CurrentWorkbook(){[Name="tblBAAM"]}[Content],

    TableA_TableB = Table.AddColumn(TableA, "Outcome", each Table.SelectRows(TableB, Expression.Evaluate("(Magic) => [RouteName]=Magic[RouteName]", [Magic=TableB]))),
    Result = Table.ExpandTableColumn(TableA_TableB, "Outcome", {"Outcome"})

in

    Result

 

 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @JVos 

Try

TableA_TableB = Table.AddColumn(TableA, "Outcome", each Table.SelectRows(TableB, Expression.Evaluate("(Magic) => [Name]=Magic[Name]", [ _ = _ ] )))

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

 

View solution in original post

2 REPLIES 2
JVos
Helper IV
Helper IV

@AlB Thank you very much! This worked - with a minor change, because the column name is not Name, but RouteName.

 

JVos

AlB
Super User
Super User

Hi @JVos 

Try

TableA_TableB = Table.AddColumn(TableA, "Outcome", each Table.SelectRows(TableB, Expression.Evaluate("(Magic) => [Name]=Magic[Name]", [ _ = _ ] )))

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors