Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

JavaScript code that will communicate with Power BI

Currently I'm using API to call my Stored Procedures as data source to all of my tables in power bi. But as time passed by the database is getting bigger and bigger that power bi can't load it anymore or may took quiet some time to load or refresh the data from power bi tables. So I'm thinking for a solution to have a dynamic parameter Dates (Start and End) that will prompt to ask the users to enter before proceeding on rendering all the visuals of the report.

 

Is there a way for my Stored Procedure date parameters to be dynamic or changed based on user inputs?  (Javascript is what came first through my mind but don't know how.)

 

As an example of my web api sp source below, I had to fixed the dtStart to 2018-01-01 and dtEnd to 2018-06-12 of my Stored proc.

 

= Json.Document(Web.COntents("http://10.106.167.65:7006/Api/WebAPI?sp=PE_ResponseTimeReport&param=%272018-01-01%27,%272018-06-12%27,4,1))

 

 

 

api.png

 

 

Thanks in advance!

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @chesterraepined,

 

>>Is there a way for my Stored Procedure date parameters to be dynamic or changed based on user inputs?  

You can consider to use query parameter to parametrize your connection query.(you should modify your api to receive query string parameters first)

Deep Dive into Query Parameters and Power BI Templates

 

Notice:

power bi will disable javascript functions/codes when get data from website.So if your filter is based on javascript functions, I don't think it is possible.

 

Regards,
Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @chesterraepined 

 

I have a slightly different question. How to do call Stored Procedure using API or external event like a click of a button or using PowerBI API. It would be grateful if you could share some of your ideas.

 

Thank you in Advance.

 

Cheers!

Anonymous
Not applicable

HI @chesterraepined,

 

>>Is there a way for my Stored Procedure date parameters to be dynamic or changed based on user inputs?  

You can consider to use query parameter to parametrize your connection query.(you should modify your api to receive query string parameters first)

Deep Dive into Query Parameters and Power BI Templates

 

Notice:

power bi will disable javascript functions/codes when get data from website.So if your filter is based on javascript functions, I don't think it is possible.

 

Regards,
Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.