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
onovoletto
Regular Visitor

REST API - ExecuteQueries Function

Hello guys,

 

I need to execute a query with function "ExecuteQueries" from PBI API, but i have to send my Query DAX with params and variables, that function support variables e definition like 

DEFINE VAR __DS0FilterTable = TREATAS({'Some value'}) ?
 
Because I receive a return like syntax error:
Query (1, 174) The following syntax error occurred during parsing: Invalid token.
 
Thank you.
2 REPLIES 2
GilbertQ
Super User
Super User

Hi @onovoletto 

 

What I would suggest doing is to first input your variables into a long piece of text so that you are not putting the variables at runtime.


Then in the next step pass this entire string text to the ExecuteQueries and see if that works?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Do you know how I pass the dynamic M query params with this request "ExecuteQueries"?

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.