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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
servicetagapp
Frequent Visitor

Power Bi Embedded - Programmatically Refresh Dashboard

Hi,

I can show the dashboard embedded in my webapp. I use the Power Bi client for Java to get AccessToken and EmbeddedURL, then I use the Power Bi client for Angular to embed the report in the gui.

 

I would like to programmatically update my embedded dashboard after a certain time set by the user. I was able to integrate this functionality for embedded reports using the "refresh" method of the client for Angular. For the embedded dashboards I saw that there is the "reload" method of the library. This however reloads the dashboard but the updated data are not shown.

Regarding this issue I have noticed that the data in the dashboard sometimes does not even update in the power bi web service.

Could someone tell me, if possible, the correct way to set this feature?

 

Thanks for support

7 REPLIES 7
DMiradakis
Advocate II
Advocate II

Ok, so this is a really specific, but really good question, and no one seems to address it in the Microsoft Docs.

 

I'm in the same boat, I've built a custom Power BI app to display reports and dashboards for users on TVs or other unattended devices. What I found was that the dashboards behaved rather unpredictably regarding an automated refresh. As you correctly pointed out, the "refresh" method from the Power BI JavaScript SDK only works for Power BI reportsnot Power BI dashboards.

 

What I have since discovered is that, for both Import Mode and Direct Query dashboards, I had to setup an automated refresh pipeline to refresh the dataset(s) behind the dashboard itself. Again, that was for both Import Mode and Direct Query datasets. When the automated refresh pipeline would trigger a refresh in the dataset, then I would notice that my embedded dashboard would also auto-update the visuals on the web page.

 

The implied restriction here is that you really need Power BI Premium Per User (PPU) or Premium, as you'll run into a hard limit of 8 refreshes/day if you only use Power BI Pro.

v-lionel-msft
Community Support
Community Support

Hi @servicetagapp ,

 

v-lionel-msft_0-1619686821228.png

The scheduled cache refresh is used to refresh the tile cache. Has your refresh plan been executed successfully every time? After it is executed successfully at a certain point in time, then load the dashboard again and check whether the dashboard displays the latest data.

 

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.

Hi,

After refresh il executed successfully the dashboard is still not updated, but when i trigger the dashboard refresh from power bi service, then dashboard shows latest data

If I disable scheduled refresh, then dashboard does not keep cache and refresh each time it is loaded?

Thanks for support

Best regards

v-lionel-msft
Community Support
Community Support

Hi @servicetagapp ,

 

"Regarding this issue I have noticed that the data in the dashboard sometimes does not even update in the power bi web service."

 

Can the datasets that make up the dashboard be refreshed normally? Dashboard refresh (Tile refresh is done automatically).

Tile refresh 
What is your data source? What is your connection mode?

 

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.

Hi

My datasource is a SQLServer connected by DirectQuery

Dataset refreshes with a delay of 2 hours.

Thanks for support

Best regards

Hi @servicetagapp ,

 

"Dataset refreshes with a delay of 2 hours."

 

For Direct Query mode, the queries is not actually sent to the dataset (the dataset is empty in this mode), the queries is sent to the data source for calculation and returned to the report, so when you load the report or interact with the report, the report shows the latest data from the data source, so the 2 hour delay is strange.
The data of tiles in the dashboard comes from the cache of each tile. I think the reason why your dashboard is not updated is that the cache of tiles is not updated in time.
The most critical problem should be the 2 hour delay you mentioned.

Could you explain in detail how the delay of 2 hours is generated?

 

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.

 

Hi @v-lionel-msft,

I have set the dataset scheduled refresh in power bi service with a delay of 2 hours.

servicetagapp_0-1619601173525.png

 

When I load the report or interact with the report, the report shows the latest data from the data source: this works well.

However, whem i load the dashboard, the dashboard does not show the latest data from the data source, like the report does.

How can i manage the cache of tiles so that dashboards show always the latest data?

 

Thanks for support

Best regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.