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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Magpie_Rob
Helper I
Helper I

Distance Bins based on long and lat

Hello

 

So I have 2 tables, on with customers and there Longitude and Latitude and anotherone with Stores with there longitude and latitude - I'm trying to create a table with a list of the stores and how many customers fall withing certain distance (in bins). (5miles, 10miles, 15 miles) etc. I have included an excel table of how I would expect it to look.

Distance Bins.png

 

I found a measure created by RADCAD which figures out the distance but I can't figure out how to make this work across mutilple stores and count it plus put it into bins. any help is greatly appricated. - I included a sample Pbix as well. 

 

https://1drv.ms/u/s!ApUZenl1efyn03AHr5mVd-BZI1Tk?e=Wgos2m

 

Thanks 

Magpie

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@Magpie_Rob is this what you are looking for:

 

parry2k_0-1613171309698.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

This was the main bit! it worked really well thank you! 

Store Distance Bins = 
ADDCOLUMNS (
    CROSSJOIN (
        VALUES ( Store_Location[Postcode] ),
        VALUES ( 'Customers Locations'[id] )
    ),
    "Miles", [Miles],
)

 

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@Magpie_Rob I'm so so sorry about this. I totally messed up. Thanks for keep on following up. Filesize is bigger than the size I can attach here, let me know how else I can send it to you.

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k  no worries at all! everyone is busy! I have sent you a direct message with my email

parry2k
Super User
Super User

@Magpie_Rob oh! I'm so sorry for not getting back to you. Thanks for the nudge. I will send you the pbix file as soon as I'm in front of the computer.

 

Stay tuned!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k I hope you are well, at the risk of sounding really desperate could you please share the Pbix with me please ? 

Thank you! 

Hi @parry2k I hope you are well,

I fear you may have forgotten me again 🙈 at the risk of sounding desperate could you please share the Pbix with me please ? 

Thank you! 

parry2k
Super User
Super User

@Magpie_Rob is this what you are looking for:

 

parry2k_0-1613171309698.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

This was the main bit! it worked really well thank you! 

Store Distance Bins = 
ADDCOLUMNS (
    CROSSJOIN (
        VALUES ( Store_Location[Postcode] ),
        VALUES ( 'Customers Locations'[id] )
    ),
    "Miles", [Miles],
)

 

@parry2k yeah thats exactly what I'm looking for! are you able to share the pbix or let me know how you achived it? 

Hi @parry2k just checking you haven't forgot about me! the soultion to this would be very much appricated! 

 

Thanks 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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