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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Power bi: Power Query call two datasets on a Python Script

Hi, I have 2 datasets "Evolution" and "Status" and I have a python script that makes some transformations using both of them. When I go to the Evolution data and Run Python script, by default the it is called dataset. What will be the name of Status if I want to call it in the same python script? or, What should I use to call both them in the same script?

python.jpg

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,


Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.


Best Regards,
Stephen Tao

freginier
Super User
Super User

See this

https://stackoverflow.com/questions/51947441/power-bi-how-to-use-python-with-multiple-tables-in-the-...

 

One of my script I merge two existing queries with python statement

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Run Python script" = Python.Execute("# Python:#(lf)import pandas as pd#(lf)df3 = pd.merge(df1, df2, how = 'left', on = ['Date'])",[df1=Table1, df2=Table])
in
    #"Run Python script"

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors