Forum Discussion
How to read SQL requests in an Excel file?
Hi everybody,
Is there a way in Power BI to read SQL requests in an Excel file and then to dynamically execute them and get the results ?
6 Replies
- AnonymousNot applicable
Yes, with M, you can iterate over a series of queries and pass those into the Sql.Database() function in the query parameter. Although, if you do this, they'll all be in one "set", so you'll have to decide if you're going to append them or split them out into separate queries.
- Bertrand_frRegular Visitor
Hi SonnChilds,
Thanks a lot for this detailed explanation, works great!
Now I'm trying to find where is the result set?
How can I use it?
- AnonymousNot applicable
Each result set resides in that "Table" value with the yellow text. Try clicking on the word "Table", and you'll add a step navigating to that result set. Alternatively, you can use the split arrows at the top of that column to expand out the tables, but only do this if all of your result sets are of the same structure (i.e. a union).