Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
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?
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 11 | |
| 11 | |
| 7 | |
| 6 |