Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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 9
AlB
Super User
Super User

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
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?

@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. 

Anonymous
Not applicable

Yeah, Area Codes are not great when it comes to location based plotting.  For example Area Codes for Key West, Florida are 305 & 786 and they both have the same latitude & longitude.  It may not be possible since a majority of my calls are in the Dallas area which has three area codes that serve the same coordinates.   I wonder if I should find like values are just barely change them so that they are unique like 32.78306, 32.78307, 32.78308.  It might slightly throw off my coordinates but by how much?

 

Or maybe look for a better area code data source. 


 


 

 

@Anonymous

Ok but you seem to be saying that what is not unique is the longitude and latitude. That should not matter. If the area codes in your Longitude/Latitude table are unique we're fine. Are they?

Can you share the pbix? That would make things faster

Or if you have sensitive info maybe just a pbix with the two tables involved that we are discussing  

Anonymous
Not applicable

Was that dropbox link able to work for you?

 

 

@Anonymous

 

I had a look but couldn't make much of it. The problem is that the Latitude/Longitude pairs are defined not only by area codes but by area codes and the City. So either:

 

1. You need to take the city into account to make the lookup (i.e., are code plus City) --> Can the 'Call to' column can be used to extract the city?

2. or  you have to make the area codes in the Latitude/Longitude pairs table unique. Otherwise what Latitude/Longitude do you take if there are several for the same area code? How you do this depends on your requirements. Maybe keep one that is representative? Maybe it doesn't matter that much because they are all close to one another? Maybe you need the average?

 

 

Anonymous
Not applicable

https://www.dropbox.com/s/k5fwlht3etpe6w1/Template%20Dashboard%20-%20Phone%20Records.pbix?dl=0

 

Yes. It is personal information but I've grab a limited section to give you a snapshot of the dashboard. 

Anonymous
Not applicable

Basically I'm trying to create a heat map of call frequency to certain area codes.  So I will need distinct count of area codes as well.  I got stumped on the longitude/latitude before I got to that measure. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.