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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

dax splitting by using measure

Hi,

 

there is a column(GeoLocation) with  (latitude,longitude). how to split latitude and longitude as two differet columns by using only measure.

 

Thank you

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

az38's suggestion is great , you can also create measures like DAX below.

 

Latitude=
var Comma= FIND(",",Table1[GeoLocation],1)
return
MID(Table1[GeoLocation],1,Comma-1)
 
Longitude=
var Comma= FIND(",",Table1[GeoLocation],1)
Var Len=LEN(Table1[GeoLocation])
return
MID(Table1[GeoLocation],Comma+1,Len-Comma)

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

az38's suggestion is great , you can also create measures like DAX below.

 

Latitude=
var Comma= FIND(",",Table1[GeoLocation],1)
return
MID(Table1[GeoLocation],1,Comma-1)
 
Longitude=
var Comma= FIND(",",Table1[GeoLocation],1)
Var Len=LEN(Table1[GeoLocation])
return
MID(Table1[GeoLocation],Comma+1,Len-Comma)

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

hi @Anonymous 

it depends on exactly format of your column. show a data example, please

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
az38
Community Champion
Community Champion

@Anonymous 

anyway, try this column

=
VAR V_Pos = FIND(",",[GeoLocation]) 

RETURN
    ROW(
        "Lat",LEFT([GeoLocation],V_Pos-1),
        "Long",RIGHT([GeoLocation],LEN([GeoLocation])-V_Pos)
    )

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.