LOOKUP Select Column/Field?

SpillerBD

Well-known Member
Joined
Jul 2, 2014
Messages
2,688
In Excel I can perform a lookup that uses the desired column for the return value by varying the column in the formula.
How can this be done on either the Query side or the PowerPivot side of PowerBI?
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811


Query Result:

Code:
let
    Source = Table.NestedJoin(Data,{"Category"},LookupTable,{"Category"},"LookupTable",JoinKind.LeftOuter),
    #"Added Custom" = Table.AddColumn(Source, "ReturnValue", each Table.Column([LookupTable],[RequiredField]){0}, type text),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"LookupTable"})
in
    #"Removed Columns"
 

SpillerBD

Well-known Member
Joined
Jul 2, 2014
Messages
2,688
Awesome! Though it'll be a bit for me to digest and implement (just priorities to get back to the project at the office.)
 

Forum statistics

Threads
1,077,827
Messages
5,336,612
Members
399,092
Latest member
jbwatkins

Some videos you may like

This Week's Hot Topics

Top