Forum Discussion
Distance Filter Not Working
- 3 years ago
I didn't solve this problem directly but I was able to solve it indirectly. I was able to remove the 'Max Distance' Slicer and replace with a column called Area of Operation in a table also called 'Area of Operation'.
I made a new table, called Area of Operation, that had the name of each organization and then a column that contained the operating radius of that company in kilometers. So then I changed my Points in Proximity equation. You will see that monay of the business have a 5000 KM range. This just means they will travel/deliver anywhere within the state or country and they will always return "In Range". While other companies have a much smaller range of operation.
Points in Proximity = IF('Organization_Info'[Distance (km)] <= SUM(Area_of_Operation[Area of Operation (km)]),"In Range","Out of Range")I also had the state columns that could be used as additional filters within the report, as the radius of operation for some these business would be large enough to bleed into that state. I did this because some of these businesses do not operate in that state, even though their radius may extend into a bordering state.As you will see below, I then made individual slicers for each state column from the 'Area of Operations' table. This allows me to further filter my results by only choosing businesses that operate within that state.Not the prettiest of solutions but it did allow me to filter my results properly.
First of all, measures should not be used in calculated columns. I see quite a few examples of this on the forum and it's a bad idea.
The other problem though is that you might be assuming what the number is that you are getting from that measure.
Am i right in saying the calculated column Points in Proximity is created in the 'Organization_Info' table? What value is supposed to be returned from the 'Maximum Distance (km)' table to use it in a comparison? I don't see any relationship so the SELECTEDVALUE will probably be returning the 1st or last value in the table and I don't think that's what you want.
HotChilli, I love your name thanks for helping me out lol.
1. The reason I used a measure in the calculated column, was because I'm not sure how else I could accomplish that calculation, but if you know better then I would happily use your suggestion.
2. You are correct in saying that the PiP is created in the 'Organizational_Info' table.
3. 'Maximum Distance (km)' is supposed to simply serve as a radius around a city. That number is then compared to the 'Distance' calculation for a given business. Any business within that radius will appear as "In Range", or just filter out any business not in the radius.
4. Yeah I am confused on how SELECTEDVALUE is supposed to work. I pulled most of what I am doing from that link I provided at the top. The person who made that project provided a github download and I have been trying to recreate what they did.