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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.