LOOKUP Select Column/Field?

Results 1 to 3 of 3

Thread: LOOKUP Select Column/Field?

  1. #1
    Board Regular
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    2,076
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default LOOKUP Select Column/Field?


    LOOKUP Select Column/Field?
    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?
    Excel 2013, 2016 with PowerBI
    Knowing that it can be done is half the battle!

  2. #2
    Board Regular MarcelBeug's Avatar
    Join Date
    Apr 2014
    Posts
    1,800
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: LOOKUP Select Column/Field?



    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"
    Specializing in Power Query (M).
    Using Excel 2007 (Dutch) and Excel 2016 (Office 365 ProPlus) (Dutch/English), both on Windows 10.
    Array formulas can be recognised by the {} Excel puts around it automatically when you press Ctrl+Shift+Enter upon formula entry.

  3. #3
    Board Regular
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    2,076
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: LOOKUP Select Column/Field?

      
    Awesome! Though it'll be a bit for me to digest and implement (just priorities to get back to the project at the office.)
    Excel 2013, 2016 with PowerBI
    Knowing that it can be done is half the battle!

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com