Forum Discussion
jsteffe
Helper III
3 years agoBing map API : how to manage null results ?
I get this custom function that gives the address based on latitude and longitude using the BING MAP API : let
FindLoc= (lat, lon) =>
let
Source = Xml.Tables(Web.Contents("http://dev.virt...
- 3 years ago
That's not DAX, it is Power Query.
let FindLoc= (lat, lon) => let Source = Xml.Tables(Web.Contents("http://dev.virtualearth.net/REST/v1/Locations/"&Replacer.ReplaceText(Text.From(lat),",",".")&","&Replacer.ReplaceText(Text.From(lon),",",".")&"?o=xml&key=AqXbM3RmYA05LA89D0jBdRSYxgrYNUOwSNEsDS2G9aXaYBqFDOIYDT8IPoHKhJRp")), #"Removed Other Columns" = try Table.SelectColumns(Source{0}[ResourceSets]{0}[ResourceSet]{0}[Resources]{0}[Location]{0}[Address],{"FormattedAddress", "Locality"}) otherwise #table({"FormattedAddress","Locality"},{{"undefined","undefined"}}) in #"Removed Other Columns" in FindLoc
lbendlin
Super User
3 years agoThat's not DAX, it is Power Query.
let
FindLoc= (lat, lon) =>
let
Source = Xml.Tables(Web.Contents("http://dev.virtualearth.net/REST/v1/Locations/"&Replacer.ReplaceText(Text.From(lat),",",".")&","&Replacer.ReplaceText(Text.From(lon),",",".")&"?o=xml&key=AqXbM3RmYA05LA89D0jBdRSYxgrYNUOwSNEsDS2G9aXaYBqFDOIYDT8IPoHKhJRp")),
#"Removed Other Columns" = try Table.SelectColumns(Source{0}[ResourceSets]{0}[ResourceSet]{0}[Resources]{0}[Location]{0}[Address],{"FormattedAddress", "Locality"})
otherwise #table({"FormattedAddress","Locality"},{{"undefined","undefined"}})
in
#"Removed Other Columns"
in
FindLocjsteffe
Helper III
3 years agoThanks a lot for your help which was so helpful !