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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
saferguson
Regular Visitor

Calculation across multiple rows

I have a data set of store locations (100+ rows) and want to work out for each row what it's next nearest store is, from the same list. To do this in excel I would use an array function work out the distance between all stores using their coordinates, then find the minimum. Is there an easier way to do this in Power BI so that when the list is updated it automatically calculates?

 

Similarly is there a way to do this so I can find stores within a certain radius of a chosen store?

 

Thanks!

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @saferguson,

 

Please share a sample data. A formula is needed. But we can't create a formula without data and its structure.

 

Best Regards,

Dale

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

@v-jiascu-msft - Hi Dale, I've added an example to the thread

StoreLatLongSize (sqm)Region
A51.50735-0.12776100London
B51.51178-0.12319200London
C53.48076-2.24263300Manchester
D53.40837-2.99157200Liverpool
E36.31342-95.6216100Bath
F52.40682-1.51969150

Coventry

 

Here's an example, there are a few more columns but these are all details not needed for the calculation

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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