It’s the final week of mapping month! This week we are plotting points on a map within a selected radius. It’s common to want to see locations, such as stores or restaurants that are nearby to a selected location. This week we are exploring one way to do that in Power BI. This involves a fun bit of DAX and some conditional formatting.
This week we are mapping Dutch Bros Coffee locations. This is a coffee chain based in Oregon, USA that has locations in about 13 states throughout the country. I enjoy their cold brew, but they have many hot, cold, and frozen drink options.
- Retrieve the Dutch Bros location data and the list of cities from data.world.
- Create a map visual that plots the Dutch Bros locations using longitude and latitude.
- Use the “CityLatLong.xlsx” table to populate state and city slicers.
- Create a DAX calculation that uses the haversine formula to calculate distance from the selected city in the slicers to each Dutch Bros location. (I chose to use kilometers, but feel free to do miles if you prefer.)
- Create a slicer to allow users to filter on distance from store locations to the selected city.
- Add a visual (I used a table) to list the store addresses and the distance from the selected city.
- Configure the map and table so they only show locations within the selected distance radius. (Hint1, Hint2)
This challenge uses data provided on data.world. You can use the data.world connector in Power BI (recommended) or download the Excel file to your local machine. You will need to log in to data.world to retrieve the data, but accounts are free.