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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cwayne758
Helper IV
Helper IV

Attempting to break down sales by county---but keep getting duplicate value

Hi,

 

So I am trying to analyze sales by county-level (within the United States) but our datamart only drills down to City & State level. 

 

In order to get the County description, I imported a CSV file that includes all cities and counties by State within the United States.

 

When I go to merge the two queries inside of the Query Editor, all my values in FactSales end up getting duplicated, and the Expanded Column shows the incorrect county. 

 Duplicated ValuesDuplicated Values(Huntsville, Alabama should show Limestone County)

 

Any suggestions as to how I can clean this up? My thought was to try to get zipcode info  for that particular sales record but wanted to try all workarounds before contacting IT. Not sure if that would even help.

 

Anyways, thanks in advance! 

1 ACCEPTED SOLUTION
bherring1979
Frequent Visitor

Related Country = Related('Countries'[Country])

If you import that csv then make a relationship between the 'Sales'[City] and 'Countries'[City], you should be able to bring the country value into the data you're working with. You'll need to replace the names in quotes to your field names.

 

View solution in original post

2 REPLIES 2
bherring1979
Frequent Visitor

Related Country = Related('Countries'[Country])

If you import that csv then make a relationship between the 'Sales'[City] and 'Countries'[City], you should be able to bring the country value into the data you're working with. You'll need to replace the names in quotes to your field names.

 

I wrote country in every one of those, but meant county...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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