Forum Discussion
DAX - Dynamic Measure based on slicer selection
- 4 years ago
Get the lat, long of the site in the same fashion:
VAR IDLat = SELECTEDVALUE(EventTable[Lat])
VAR IDLong = SELECTEDVALUE(EventTable[Long])
VAR SiteLat = SELECTEDVALUE(SitesTable[Lat])
VAR SiteLong = SELECTEDVALUE(SitesTable[Long])
then apply your formulae.
If this does not work I'd probablyn need a mock pbix reproducing the issue so that I can see exactly what you are doing. You have to share the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).
Please accept the solution when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Hi MischaT
As AlB mentioned, it's not clear how do you want to calculate a distance? do you want to replace the selected ID Lat and Long with Lat1 and Long 1 in your formula or Lat 2 and Long 2??? I think you want to replace that with Lat and Long 2!
Can you share a sample of DB_ISITES table?
BTW, if you select an ID on a slicer that will filter the EVENT table and then Lat1 and Long1 will return the Lat and Long of the selected ID.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/