Forum Discussion

MartinC's avatar
MartinC
Icon for Helper I rankHelper I
3 years ago
Solved

How to get a column from table B into Table A?

Hi All,

I've been trying all day to get this done and it's just not working for me 😞  Please help! I know it should be easy but I'm struggling...

So, I have a table called "Milestones" and another table called "UDFS".  They both have a column called "ID".  I want to get the column "UDFValue" from the "UDFS" table into the "Milestones" table.  I've tried creating a new column in the "Milestones" table and using LOOKUPVALUE and RELATED but can't get either to work 😞

Thanks in advance!

  • MartinC Not 100% positive I am fully tracking the issue but perhaps this?

    Column =
      VAR __ID = [ID]
      VAR __Result = MAXX(FILTER('UDFS',[ID] = __ID && [UDFID] = 68),[UDFValue])
    RETURN
      __Result

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    MartinC You could try a Merge step in Power Query Editor or perhaps try this:

    Column =
      VAR __ID = [ID]
      VAR __Result = MAXX(FILTER('UDFS',[ID] = __ID),[UDFValue])
    RETURN
      __Result
    
    • MartinC's avatar
      MartinC
      Icon for Helper I rankHelper I

      Greg_Deckler this puts an x in the column (so progress, thanks!) but I need the values from the column?

  • Greg_Deckler I see my error (but don't know how to fix it) - ID in table UDFS has multiple UDFID values - is there a way to filter for the UDFID value of 68 to give the UDFValue for those only? Thanks πŸ™‚

    • Greg_Deckler's avatar
      Greg_Deckler
      Icon for Community Champion rankCommunity Champion

      MartinC Not 100% positive I am fully tracking the issue but perhaps this?

      Column =
        VAR __ID = [ID]
        VAR __Result = MAXX(FILTER('UDFS',[ID] = __ID && [UDFID] = 68),[UDFValue])
      RETURN
        __Result
      • MartinC's avatar
        MartinC
        Icon for Helper I rankHelper I

        Greg_Deckler you are officially my hero! Thank you so much! Side question - where is the best place to learn this sort of thing? I would never have gotten to that solution on my own.