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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
thmonte
Helper IV
Helper IV

Ejecución de Python Script en dataset

Me estoy conectando a una base de datos SQL que tiene algunos datos GPS en ella. Quiero usar esto para trazar en un mapa en PowerBI pero los datos están en State Plane Coordinate System no En Lat, Long. Python tiene pyproj que hará la conversión por mí. ¿Hay alguna manera de ejecutar una función python en las columnas de la tabla SQL y devolver el resultado en esa tabla?

La secuencia de comandos python es muy simple, donde los valores x,y serían los valores de dos columnas de la tabla sql

import pyproj

# http://spatialreference.org/ref/epsg/4269/
NAD83 = pyproj.CRS("EPSG:4269")
# http://spatialreference.org/ref/esri/nad-1983-stateplane-new-york-long-island-fips-3104-feet/
NYSP1983 = pyproj.CRS("ESRI:102718")


x, y = (923262, 139019)
result = pyproj.transform(NYSP1983, NAD83, x, y)

print(result)

¿Es posible? ¿O tengo que hacer la conversión completa en Python?

1 REPLY 1
amitchandak
Super User
Super User

@thmonte , refiérase a esto. Puede correr

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts

Pero usted tiene comprobar si este paquete es compatible con power bi - pyproj( Si no es necesario en la interfaz de usuario, Usted debe ser capaz de utilizar)

https://powerbi.microsoft.com/en-us/blog/python-visualizations-in-power-bi-service/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors