Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mrbajana
Helper III
Helper III

Extract Lat and Log from csv with a google link column

I have a text file with a column that has thousands of records with the google links maps as I show it below:

 

https://www.google.com/maps/place/2%C2%B003'02.4%22S+79%C2%B054'42.5%22W/@-2.0506784,-79.9139984,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d-2.0506784!4d-79.9118097?hl=es

 

In some links there is a different position.

 

How do I extract the latitude and longitude of that link?

 

Marco

1 ACCEPTED SOLUTION
ChrisMendoza
Resident Rockstar
Resident Rockstar

This work for your data @mrbajana?

Column = 
VAR countLeftText =
    FIND ( "/@", Table1[hyperlink] ) + 1
VAR leftText =
    LEFT ( Table1[hyperlink], countLeftText )
VAR makeLeftBlank =
    REPLACE ( Table1[hyperlink], 1, countLeftText, "" )
VAR findLat =
    FIND ( ",", makeLeftBlank ) - 1
VAR latText =
    LEFT ( makeLeftBlank, findLat )
VAR findLong =
    FIND ( ",17z", makeLeftBlank, findLat + 1 )
VAR longText =
    LEFT ( makeLeftBlank, findLong - 1 )
RETURN
    longText





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

1 REPLY 1
ChrisMendoza
Resident Rockstar
Resident Rockstar

This work for your data @mrbajana?

Column = 
VAR countLeftText =
    FIND ( "/@", Table1[hyperlink] ) + 1
VAR leftText =
    LEFT ( Table1[hyperlink], countLeftText )
VAR makeLeftBlank =
    REPLACE ( Table1[hyperlink], 1, countLeftText, "" )
VAR findLat =
    FIND ( ",", makeLeftBlank ) - 1
VAR latText =
    LEFT ( makeLeftBlank, findLat )
VAR findLong =
    FIND ( ",17z", makeLeftBlank, findLat + 1 )
VAR longText =
    LEFT ( makeLeftBlank, findLong - 1 )
RETURN
    longText





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.