Forum Discussion
Assign first value available from an other table
- Anonymous2 years ago
Hi Sima007 ,
Yes, you can.
Before you begin, you need to install Python and Pandas.
In Power BI desktop, specify the installation path of Python.
File > Options and settings > Options > Python scripting
In the Power Query editor, select and enter the Python code for the calculation.
Transform > Run Python script
There are some limitations for queries contained in Python scripts created in Power Query:
All Python data source settings must be set to Public, and all other steps in queries created in the Power Query Editor must be set to Public.
To enable scheduled refresh for a Python visual or dataset, you need to enable Scheduled Refresh and install Personal Gateway on the computer where the workbook and Python installation are stored.
Nested tables (tables within tables) are not currently supported.
For more information see:
Use Python in Power BI Power Query Editor - Power BI | Microsoft Learn
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi Sima007 ,
I tried it and found it difficult to achieve this requirement.
Your requirement needs to be checked line by line to determine whether the conditions are met - that is, addresses cannot be repeated.
My suggestion is that if possible, consider assigning addresses to products based on your criteria in a database or using a scripting language like Python.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hello Anonymous
is it possible to use Python in power bi to do this calculation?
Thanks
- Anonymous2 years agoNot applicable
Hi Sima007 ,
Yes, you can.
Before you begin, you need to install Python and Pandas.
In Power BI desktop, specify the installation path of Python.
File > Options and settings > Options > Python scripting
In the Power Query editor, select and enter the Python code for the calculation.
Transform > Run Python script
There are some limitations for queries contained in Python scripts created in Power Query:
All Python data source settings must be set to Public, and all other steps in queries created in the Power Query Editor must be set to Public.
To enable scheduled refresh for a Python visual or dataset, you need to enable Scheduled Refresh and install Personal Gateway on the computer where the workbook and Python installation are stored.
Nested tables (tables within tables) are not currently supported.
For more information see:
Use Python in Power BI Power Query Editor - Power BI | Microsoft Learn
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!