0

I already read this post before: Power BI: How to use Python with multiple tables in the Power Query Editor?

I'd like to do something like this inside PBI:

import pandas as pd
import numpy as np

proc = cad_processo
moeda = tab_moeda_data

def name_of_the_function(proc, moeda):
   df = code...
   return df

Now I'll explain more in-depth what I'm doing:

I'm in a table called cad_processo, I need to apply a very complex function to create a column in cad_processo, but in order to create this new column, I need another table called tab_moeda_data.

I tried what was explained in the post I quoted before, but I wasn't able to achieve nothing so far.

In theory it's simple, import 2 tables and apply a function to create a new column, but I'm not being able to import this second table (tab_moeda_data) into the cad_processo to apply the function.

Image

*I know that cad_processo is called dataset in this case I only need to import another table (tab_moeda_data) to apply the function, that's it.

Can anyone help me?

1 Answer 1

0

This is a feature that the UI doesn't support, so you have to use the Advanced Editor.

But you can simply pass additional Tables to Python.Execute, eg

MainTable = ...,
RunPythonscript = Python.Execute(pythonScript,[dataset=MainTable, otherTable=OtherTable]),

And they will be available as additional pandas DataFrames in your script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.