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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Arbind
Frequent Visitor

Regarding Refresh Option Available In Power Bi

Dear All,

 

I would like to know if it is possible to enable automatic dashboard refresh when the data is connected through a Web API. Currently, I am using the Power BI Free Desktop Version, but I am considering upgrading to a Power BI Pro License. I would like to know if this upgrade is necessary to solve my problem. Your suggestions and recommendations would be greatly appreciated.

Problem Statement : When attempting to refresh the dashboard that retrieves data from a Web API (using Postman to generate authentication and bearer token, then importing it into Power BI through ODATA), the refresh option is not functioning. An error is displayed as (500): Internal Server Error. What steps can be taken to resolve this issue?

 

Additionally, during the process of continuously refreshing, I may encounter an error. However, at some point, the refresh button will finally work and my dashboard will be refreshed after approximately thirty minutes. It's worth mentioning that I am performing all of these actions within a Virtual Machine.

 

I urgently require a solution for the problem I am currently facing. It is of utmost importance that I obtain this solution in a timely manner. 

Thank you for your assistance in advance.

 

The Error i am gettingThe Error i am getting

2 ACCEPTED SOLUTIONS
ibarrau
Super User
Super User

Hi. You don't need pro license if you just want to build a report that automatically refreshes for yourself. You need licenses when you want to start collaborating or sharing with others.

Regarding the error it's not a Power Bi error. As you describe sometimes it work and other doesn't, the error 500 means that something went wrong at the server side (the api side). The API creater has created that exception of 500 when something is wrong. It might be the amount of data, it might be getting the data for odata or it can simple be that the api can't handle that amount of requests. Usually the api creators reserve the 500 error when they are not sure about the specific thing that went wrong. You can try different things regarding amount of records or if one of the tables has the issue, but it's not something you can fix even if you find the pattern. For example, you try different things and find out that when you ask for data from two years it fails, but one year works everytime. You can't change that, you can just adapt.

I hope that make sense


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

Happy to help!

LaDataWeb Blog

View solution in original post

Hi, @Arbind 

First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.

Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn

vjianpengmsft_0-1710472726478.png

 

In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:

Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn

vjianpengmsft_1-1710472726412.png

Error of invalid credentials You can try the following authorization URL:

Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token

You can learn how to authorize the Power BI API in Azure AD through the following links:

Embed Power BI content in an embedded analytics application with service principal and an applicatio...

 

 

 

How to Get Your Question Answered Quickly

Best Regards

Jianpeng Li

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
Arbind
Frequent Visitor

I would like to express my sincere gratitude for the tremendous support you have provided. I am pleased to inform you that the issue has been resolved successfully. I am truly grateful to the entire community for their invaluable assistance.

ibarrau
Super User
Super User

Hi. You don't need pro license if you just want to build a report that automatically refreshes for yourself. You need licenses when you want to start collaborating or sharing with others.

Regarding the error it's not a Power Bi error. As you describe sometimes it work and other doesn't, the error 500 means that something went wrong at the server side (the api side). The API creater has created that exception of 500 when something is wrong. It might be the amount of data, it might be getting the data for odata or it can simple be that the api can't handle that amount of requests. Usually the api creators reserve the 500 error when they are not sure about the specific thing that went wrong. You can try different things regarding amount of records or if one of the tables has the issue, but it's not something you can fix even if you find the pattern. For example, you try different things and find out that when you ask for data from two years it fails, but one year works everytime. You can't change that, you can just adapt.

I hope that make sense


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

Happy to help!

LaDataWeb Blog

Thank you for your support, I really appreciate your response. I have a feeling that the problem may be on the API side. If possible, could you provide guidance? It would be very helpful for me. The amount of data is around 80-90 thousand or even more. As I mentioned, I am using Postman (WEB API) to retrieve data from the PSAOP Data Server. If you have any documents or procedures to help me overcome this issue, it would be greatly appreciated as it is urgent. This is considering the possibility of an issue with the API server.

 

Additionally i have this query 

let
token_url = "https://localhost:8181/api/oauth2/token",
api_base_url = "https://localhost:8181/api",
qry_str = "/IplProofTests",

body="grant_type=password&username=GatewayService&password=PSAOP@Gateway_Service!",
Source = Json.Document(Web.Contents(token_url,
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
]
)
),
token = Source[access_token],

data= Json.Document(Web.Contents(api_base_url&qry_str,
[
Headers = [
#"Authorization"="Bearer "&token,#"Content-Type"="application/json"]

]
)
)
in
data 

 

If there are any suggestions or changes needed in the query to help me perform auto token refresh, I am willing to make those changes. Currently, the query is giving an error of invalid credentials.

Hi, @Arbind 

First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.

Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn

vjianpengmsft_0-1710472726478.png

 

In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:

Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn

vjianpengmsft_1-1710472726412.png

Error of invalid credentials You can try the following authorization URL:

Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token

You can learn how to authorize the Power BI API in Azure AD through the following links:

Embed Power BI content in an embedded analytics application with service principal and an applicatio...

 

 

 

How to Get Your Question Answered Quickly

Best Regards

Jianpeng Li

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

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors