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
smsayedee
New Member

Calculating Closest Location using Lat/Long

Hi Everyone,

I’m new to Power BI so please excuse my lack of knowledge or if I’m not very specific.

 

I want to build a report to return the closest store where the product is available from customer’s preferred store.

I’ve 2 tables:

(table1) Product: (columns) PdtName, PdtDescription, PdtPrice, Store, StoreLat (latitude of the Store), StoreLng (longitude of the store)

(table2) OrderEOI: (columns) OrdrNum, PdtName, PreferredStore, PreferredStoreLat (latitude of preferred store), PreferredStoreLng (longitude of preferred store)

 

The relationship between the tables are many-to-many: PdtName *:* PdtName since the product name is unique but it may appear multiple times as it may be available at multiple stores as well as there can be orders for same product in different stores.

Ideally I would like to have a table report which would include following columns:

 

OrdrNum

PdtName

PdtDescription

PdtPrice

PreferredStore

ClosestStore (when PreferredStore = ClosestStore it would return the PreferredStore)

Distance (between the preferred and closest store)

 

Any suggestions/tips/solution would be highly appreciated.

Thanks in advance.

1 ACCEPTED SOLUTION
2 REPLIES 2

Thanks mate,

It actually solved a major issue although I still have a lot to tweak.

Cheers

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.