Forum Discussion
Filtering Locations in Power BI Map by slider value
Hi,
I have two tables:
- Table of customer with locations (lat, long): list with over 7k entries, unique
- Table of customers (relationship with table 1 established) with specific geocoordinates to multiple addresses in their surrounding (within a 10km)
- i.e. one customer (c1) has 3 addresses in the surrounding with: 2.3 km, 4.2 km and 9.2 km
- i.e another customer (c2) has 2 adresses in the surrounding with: 8.7 km and 9.9 km
First desired goal: I want to show only those customers in a map (classic power bi map), by using a slider with a single value (representing upper bound of distance in km, build with what-if parameter), that have entries in the 2nd table with distance below target value. So, if slider value shows value "7.7" then only c1 should be visible in the map, and the map should be updated if one uses the slider to change value to "8.8" showing both c1 and c2.
Second desired goal: if first goal is feasible, is it possible to filter the map again by as second single value filter entering, i.e. value "2", showing then only those customers with at least two surrounding addresses in scope?
This is how the map looks like:
What if have tried so far:
- Slider value to control map: used DAXs:
Count_subs_2 = COUNTROWS(FILTER(Distances_7700_companies, [Avg_Distkm]<= 'Distance km Parameter'[Distance km Parameter Value]))
Avg_Distkm = AVERAGE(Distances_7700_companies[DistanceKM])
however, now reaction in the map
- Controlling bubble size with DAX:
Map Point Size = IF( tbl_LongList_add_Info[Min_Dist] <= 'Distance km Parameter'[Distance km Parameter Value], 0.25, 0 )
It seems, that this solution fails to the mass of data.
Alternative solution could be: if the map solution is not feasible, a table/matrix solution would be 2nd best.
Help is highly appreciated.
Sample data for the second table, where Source Id is customer data (also in table 1), and Substr ID represents the surrounding addresses, while the last column stands for distance:
Subst_Long Subst_Lat Substr_ID Source ID Source_Latitude Source_Longitude DistanceKM
| 16.37736888 | 48.1825269 | R1162187 | AT0044261 | 48.24607005 | 16.4393404 | 8.42194814 |
| 16.35356151 | 48.1966924 | R2985067 | AT0044261 | 48.24607005 | 16.4393404 | 8.393576641 |
| 16.37807326 | 48.2063525 | W26421853 | AT0044261 | 48.24607005 | 16.4393404 | 6.329140269 |
| 16.38976479 | 48.257954 | W26644088 | AT0044261 | 48.24607005 | 16.4393404 | 3.89902267 |
| 11.76302693 | 49.6078135 | W29374760 | DE131666 | 49.6082771 | 11.79302959 | 2.161280735 |
| 11.79114932 | 49.6103766 | N10310779150 | DE131666 | 49.6082771 | 11.79302959 | 0.269767102 |
2 Replies
- lbendlinSuper User
with at least two surrounding addresseswhat is a "surrounding address" ? You mean sellers?
Have you considered having a single table , and letting DAX do the distance calculation?
- AnonymousNot applicable
Suppose, the source Id corresponds to my client and the "Substr_Id" corresponds to my client's clients. That's why the lats and longs are in two different column each. Ideally, when I use the slider, only my clients with at least one address within slider value distance is to be shown.