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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
michaelshparber
Advocate V
Advocate V

Scheduling Custom Function that calls for API with Bearer Authorization - possible in the service?

Hello,

I have to API calls with Bearer Token Authorization

The first returns a list of users

The second takes a user as a parameter and makes another API call to get some data for that user.

I have created a Custom Function and add a column that calls for this function for each user.

Works great in the desktop but cannot make it work in the Service.

Is it possible? How can I make it refresh (I need to do it with Bearer Token)

Thanks

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @michaelshparber ,

 

You try to add the Headers parameter to the connects() function:

How to refresh report that uses custom functions on Power BI Service? 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @michaelshparber ,

 

You try to add the Headers parameter to the connects() function:

How to refresh report that uses custom functions on Power BI Service? 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lionel-msft 

Thanks for the direction.

Now it allows me to enter credentials but I am getting a different error when refreshing:

Please help

Thanks!

Data source error:{"error":{"code":"ModelRefresh_ShortMessage_ProcessingError","pbi.error":{"code":"ModelRefresh_ShortMessage_ProcessingError","parameters":{},"details":[{"code":"Message","detail":{"type":1,"value":"[Unable to combine data] Section1/users (2)/AutoRemovedColumns1 references other queries or steps, so it may not directly access a data source. Please rebuild this data combination."}}],"exceptionCulprit":1}}} Table: users (2).

Hi @michaelshparber ,

 

Please refer to this this asnwer:

Unable to combine data - Please rebuild this data combination - Refresh 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lionel-msft 

I was abled to solve this using:

1. Your suggestion to put Header in the connects() function

2. Put everything to ONE query (referencing other query threw an error) thanks to this post:

https://community.powerbi.com/t5/Desktop/Formula-Firewall-Query-references-other-queries-so-it-may-n...

(I think it should work with referencing other steps, too. Maybe a bug?)

It is working now!

Thanks @v-lionel-msft !

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.