Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Comparing Values From Different Non-Related Tables

Basically, I am trying to generate a geographical map for my cell phone records.  

I have a table of cell records and created a new column called 'Area Code' that pulls the first three digits from my incoming/outgoing calls.  I have a second table with longitude's and latitudes in relation to every US area code. 

I am looking for a way to create new columns on my cell records tables for Longitude and Latitude.  I would like to compare the values for each 'Area code' column if they equal each other, then I would like the result to be the corresponding longitude and latitude.

9 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous

     

    If I understand correctly what you need, you could try this:

    Create a relationship between both tables through the Area Code (Many-to-one, the table with the coordinates on the many side)

    You can then bring the longitude and latitude into your cell records table with RELATED( ):

     

    LongitudeColumn = RELATED(TableCoordinates[Longitude])

    LatitudeColumn = RELATED(TableCoordinates[Latitude])

    • Anonymous's avatar
      Anonymous
      Not applicable

      It's not letting me relate the tables Many to One.  " The cardinality you selected isn't valid for this relationship."  The only selection it lets me accept is many to many but when I go to use the RELATED(): it will not let assign a column or table. 

       

      Can you think of a non-relationship DAX for this?

      • AlB's avatar
        AlB
        Community Champion

        Anonymous

        That's weird. Are the area codes in your Longitude/Latitude table not unique? They should. Would it be possible to eliminate the duplicates in that table?  Otherwise we'll face issues with other approaches as well.