Forum Discussion

aashton's avatar
aashton
Helper V
2 years ago

Help with combining values 2 tables

Hello,

My database consists of Airfare passengers and the flights they took.  I have Passengers table(ID, Name) that links to 2 separate billing tables (Workday T&E and UATP), one to many.  Both billing tables contain the name of the Carrier.  Both Carrier fields link back to the Merchant table, one to many.  See pic below.  I need to list the passengers by carrier.  Example, everybody that took Delta, everybody that took United.  Having trouble putting this together.  

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi aashton 

     

    You can create a measure similar to below to act as a filter field on the visual. Select Carrier column from the Merchant table and Passenger Name column from the Passengers table. 

    Passenger's Name = 
    VAR _tab1 = VALUES('Workday T&E'[Passenger Name])
    VAR _tab2 = VALUES(UATP[Passenger Name])
    RETURN
    IF(SELECTEDVALUE(Passengers[Name]) IN _tab1 || SELECTEDVALUE(Passengers[Name]) IN _tab2, 1, 0)

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!