Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
61 | |
46 | |
45 |