cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
RafDelgado Regular Visitor
Regular Visitor

Invoked Function Name in BI Desktop Queries

Hi All,

 

Does anyone know if you can specify the name of the invoked function when executing it?

 

At the minute, I have a couple of functions which are called Configuration and Servers. When invoking the functions, it generates the data table but the name of the query is "Invoked Function (#)" when ideally is need it to be Configuration (#) or Servers (#) to make it easier to work with the information. I know that you can manually change it but i have 43 invoked which means its a bit of a bore. Is there a way to scrip the function naming output?

 

 

Thanks,

 

Raf

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Invoked Function Name in BI Desktop Queries

Hi Raf,

I think we're on the same page here - just that I didn't make myself clear enough :-)

 

Instead of using a function for creating the multiple webcalls with different page numbers, create a table with those parameters instead: manually, or like this #table({"URL", "PageNumber"},{{"yourURL", 100}, {"yourURL", 200}}) or dynamically with List.Generate or so.

 

Then you add a custom column where you invoke your function (with those 2 (or more) parameters from your columns passed into):

myWebCallFunction([URL], [PageNumber])

 

Check out this post: http://exceleratorbi.com.au/power-query-combine-web-pages/

There Matt first creates the function (which you probably have already) and then from 1:20 onwards first creates his parameter table (which just contains a list of different years) and then invokes his (1) function from within a calculated column.

 

Edit: So your page numbers will be like Matt's Year numbers.

 

BTW: You can use List.Generate for an iterative calling of your web-pages where it checks with each call if there is more content to come and then perform the next step if yes or stop if no. Had that somewhere in the TechNet-forum but cannot remember any more. But maybe Chris' article will tell you all you need already: https://blog.crossjoin.co.uk/2014/06/25/using-list-generate-to-make-multiple-replacements-of-words-i...

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

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




4 REPLIES 4
Super User
Super User

Re: Invoked Function Name in BI Desktop Queries

Not sure if I understood you correctly, but you have to type in the names of your queries (function invokes) manually.

 

But I'd suggest to reduce the number of queries/function invokes to the number of distinct functions you have. So not to invoke the same function twice. Instead create a table with the different parameters that now justify your 43 different calls and add a column where your function is invoked. This would basically transfer your desired different query-names into a column of your new (big) table that can be used for filtering in your reports.

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

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




RafDelgado Regular Visitor
Regular Visitor

Re: Invoked Function Name in BI Desktop Queries

Thanks for the response Imke, much appreciated Smiley Happy. All I was after was confirmation that when invoking a function there was no way to keep the invoked name rather than the "Invoked Function" name it gives the new query. In previous versions of the desktop, a function would have called itself and updated the same query not create a new one thats all.

 

To elaborate a bit more, I was using a web data source to query a json based API site. The max number of values I could return on each call was 50 but didn't know specifically how many invokes I would need. I created a function with the web URL and used a parameter for the number of the page in the header which is why I needed to invoke so many times. I then appended the functions to a new table and renamed that, turning the rest of the invoked functions off. This wasn’t ideal but did the job. It would have been useful if they were called that actual name of the function thats all.

 

Thanks again for responding!

 

Raf

 

Super User
Super User

Re: Invoked Function Name in BI Desktop Queries

Hi Raf,

I think we're on the same page here - just that I didn't make myself clear enough :-)

 

Instead of using a function for creating the multiple webcalls with different page numbers, create a table with those parameters instead: manually, or like this #table({"URL", "PageNumber"},{{"yourURL", 100}, {"yourURL", 200}}) or dynamically with List.Generate or so.

 

Then you add a custom column where you invoke your function (with those 2 (or more) parameters from your columns passed into):

myWebCallFunction([URL], [PageNumber])

 

Check out this post: http://exceleratorbi.com.au/power-query-combine-web-pages/

There Matt first creates the function (which you probably have already) and then from 1:20 onwards first creates his parameter table (which just contains a list of different years) and then invokes his (1) function from within a calculated column.

 

Edit: So your page numbers will be like Matt's Year numbers.

 

BTW: You can use List.Generate for an iterative calling of your web-pages where it checks with each call if there is more content to come and then perform the next step if yes or stop if no. Had that somewhere in the TechNet-forum but cannot remember any more. But maybe Chris' article will tell you all you need already: https://blog.crossjoin.co.uk/2014/06/25/using-list-generate-to-make-multiple-replacements-of-words-i...

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

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




RafDelgado Regular Visitor
Regular Visitor

Re: Invoked Function Name in BI Desktop Queries

AHH! Now I get you! What an awesome way of going about it Smiley Happy. Will give it a shot and try it that way, thanks again for the suggestion Smiley Happy

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 120 members 1,527 guests
Please welcome our newest community members: