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! Request now

Reply
henryco88
Helper II
Helper II

Load table with python in power bi

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?

henryco88_0-1598455674804.png

 

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)

 

 

 

 

4 REPLIES 4
Icey
Community Support
Community Support

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.

edhans
Super User
Super User

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.

edhans_0-1598458716531.png


If you've done all of that and still have issues, please post back with specific issues.



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!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

I am running my script in get data but it does not recognize the TIMPBI table.

 

henryco88_0-1598515802294.png

 

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?

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.

Top Kudoed Authors