Forum Discussion

ez1138's avatar
ez1138
Frequent Visitor
5 years ago
Solved

Lookup, new table?

Hi, I pull from SQL server and have a handful of tables.  One table, dbo.contacts and dbo.audits, are the primary tables for this question.   For my audit table, I have 4 contacts, contact1, contac...
  • v-deddai1-msft's avatar
    5 years ago

    Hi ez1138 ,

     

    You can unpivot columns for dbo.audit and you can get a new table structure:

     

     

    And you can use merge queries or lookupvalue to get contacts:

     

    For merge queries:

     

    And for lookupvalue function:

    Name = LOOKUPVALUE('dbo contact'[Name (full_name)],'dbo contact'[Contact (contact_ID)],'dbo.audit'[Contact ID])

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai