cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Microsoft
Microsoft

Re: Calculation across multiple rows

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.
Highlighted
Regular Visitor

Re: Calculation across multiple rows

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

Highlighted
Regular Visitor

Re: Calculation across multiple rows

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

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors