Forum Discussion

driplytics's avatar
driplytics
Frequent Visitor
4 years ago
Solved

Create a custom column with value from another table

Hi, i need help with this.

i have a flight data table with column name AirportFrom  and another AirportTo, columns has IATA code(Airport Code). 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

my Goal is to show the Flight routes on a FLow map Visual.

To do this, i would like to use the Airport name instead of Airport Code. 

so, i overlayed a Dataset that has the Airportcode, Airport Names, Longitudes and Latitudes.

and Built a data Model with it.


 

 

 

 

 

 

 

 

 

 

then i tried to Create two custom columns named AirportOrigin and Airport Destination in the flight Dataset to retrieve the    Airport Names from the Overlayed table.

but i've got it all wrong with this.


My wrong solution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I would be so grateful, if i can solve this. 

probably in a more efficient way. 

 

 

 

 

 

 

 

  • Hi, driplytics 

    Delete the relationship/add a new seperate table and then try calculated columns as below:

    AirportOrigin = LOOKUPVALUE('Airport Data'[name],'Airport Data'[iata_code],'Dataset'[AirportFrom])
    Airport Destination = LOOKUPVALUE('Airport Data'[name],'Airport Data'[iata_code],'Dataset'[AirportTo])

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies