Python visuals in PowerBi
Today I will discuss how to pull data live with a python script and then display that data in a powerBi python visual.
We will be pulling stock market data with a custom function, which accepts a start date, end date and stock ticker symbol.
First lets open powerBI,next get any dummy data you have and connect to it via csv file.
This data is not important because the real data will come from a pandas dataframe that we populate with our script.
Next drag the python visual to the canvas of the report.
You may be prompted to enabled scripting, click Enable.
Now drag any data field to the values field while the Python visual is highted.
Copy and paste the script to the code dialogue, you will need to ensure that each module is installed on your machine.
If you get errors just use pip to install the module it indicates as missing
Click the run button, you should see the data pulled and displayed in your Python visual!
The plot will be generated and displayed.