Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
Need help to run python script which is on remote server or local machine using button in power bi report!
Thanks in Advanced!
Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?
@lbendlin - I have very simple web application (using flask) which I started local machine, it has API Call - In my example it is 'test_script' and that API is calling through power bi button - as action on button I selected web link passed value as "http://127.0.0.1:5000/test_script" . It working but it open to html page. My requirement is I just want to trigger that python execution not to open any html page.
Below is python script.
from flask import Flask, render_template
import datetime
app = Flask(__name__)
@app.route("/")
def hello_world():
return render_template('home.html')
@app.route("/test_script")
def test_script():
file = open(r'D:\workspace\Log Files\test.txt','a')
file.write(f'{datetime.datetime.now} - The Script Ran \n')
data = "Running Python Script"
return render_template('home.html', data=data)
if __name__ == '__main__':
app.run(debug=True)here is web url I keep on power bi button
That will always open a browser session. Consider using a Power Automate visual instead, with a flow that runs the HTTP request.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |