Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have a table in power bi loaded by sql server. I would like to use the table TIMPI in a python script in "Query Editor". How can I do it?
The script python that I would use is below. How can I use the object
import pandas as pd
from datetime import datetime
df_tim = TIMPBI[temperature>90]
now = datetime.strftime(
datetime.now(),
"%Y-%m-%dT%H:%M:%S"
)
df = pd.DataFrame(columns=('id_device', 'datetime','temperature'))
for i in range(0,len(df_tim),1):
df.loc[i] = [df_tim.iloc[i,0], now, df_tim.iloc[i,1]]
print (df)
Hi @henryco88 ,
Please refer to this post: Power BI: How to use Python with multiple tables in the Power Query Editor?
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Have you installed Python that Power BI Supports? Take a look at this article from MS that will walk you through the process.
Once you've done that, you simply use the Get Data command and select Python Script.
If you've done all of that and still have issues, please post back with specific issues.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingI am running my script in get data but it does not recognize the TIMPBI table.
Hi @edhans ,
I know how to run a python script in Power BI 🙂 My problem is that I would like to use TIMPBI table (loaded earlier, see screenshot above) in my python code. How can I do it?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.