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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

trying to correct the Latitude and longitude data

hello everyone.

i am trying to correct the latitude and longitude data in the power query but i am not finding a dax function for it.

susanpalliparam_0-1648060377384.png

i would like to correct the data by making it exact, meaning i am trying to get the accurate date which would look like this.

susanpalliparam_1-1648060530770.png

within excel i am able to do it without any issue i used the formual 

 =LEFT(D2,2)+(MID(D2,3,2)+MID(D2,5,6)/60)/60 (latitude ) and for long =-1*(LEFT(E2,2)+(MID(E2,3,2)+MID(E2,5,6)/60)/60), but i don't think i can use the same formula in power BI in the dax , so kindly tell me how i can do it ?
 
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can add two custom columns in Power Query Editor with below code.

Number.IntegerDivide([latitude],10000)+(Number.IntegerDivide(Number.Mod([latitude],10000),100)+Number.RoundDown(Number.Mod([latitude],100),0)/60)/60
(Number.IntegerDivide([longitude],10000)+(Number.IntegerDivide(Number.Mod([longitude],10000),100)+Number.RoundDown(Number.Mod([longitude],100),0)/60)/60)*(-1)

vjingzhang_0-1648544847368.png

Result

vjingzhang_1-1648544883569.png

 

Hope this helps.

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can add two custom columns in Power Query Editor with below code.

Number.IntegerDivide([latitude],10000)+(Number.IntegerDivide(Number.Mod([latitude],10000),100)+Number.RoundDown(Number.Mod([latitude],100),0)/60)/60
(Number.IntegerDivide([longitude],10000)+(Number.IntegerDivide(Number.Mod([longitude],10000),100)+Number.RoundDown(Number.Mod([longitude],100),0)/60)/60)*(-1)

vjingzhang_0-1648544847368.png

Result

vjingzhang_1-1648544883569.png

 

Hope this helps.

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

i will work on it and do the needful 

Anonymous
Not applicable

thank you

 

 

KNP
Super User
Super User

I'm not sure how your decimals shifted in the first place in the lat/long data but DAX is not really the correct place to do this data modelling. You should use Power Query (Transform Data).

 

Paste this into the advanced editor of a blank query...

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjE1NDUy1zMzMlHSUTIzMzAyNdAzsDBSio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [lat = _t, long = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"lat", type number}, {"long", type number}}),
    #"Divided Column" = Table.TransformColumns(#"Changed Type", {{"lat", each _ / 10000, type number}}),
    #"Divided Column1" = Table.TransformColumns(#"Divided Column", {{"long", each _ / 10000, type number}}),
    #"Multiplied Column" = Table.TransformColumns(#"Divided Column1", {{"long", each _ * -1, type number}})
in
    #"Multiplied Column"

 

or see attached PBIX.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!
Anonymous
Not applicable

i shall and if it works i will post it here 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.