cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tracytran
Resolver I
Resolver I

PowerBI.RefreshDataset() does not work

Hi friends, 

 

I am building my very first app which allows PowerBI user able to add/correct data directly on Power BI service by using Power Apps visual provided in Power Bi. 

 

In my case, my source data are the excel file which is hosted on Sharepoint. I was correcting the wrong reject reason from W3 to W3333. After I submitted the form, I checked my original data on the excel file, it updated. However, it did not refresh the visual on Power BI. It still kept W3. 

 

tracytran_1-1636343096544.png

 

I tried using PowerBIIntegration.Refresh() and PowerBI.RefreshDataset() but there was no luck. 

 

tracytran_0-1636342615815.png

 

Could anyone please help me regarding this issue? 

 

Thank you for your support. 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

Once the above post is completed then remove the button and update the code 

 

Notify("Successful")
Set(
    ReturnString,
    ResetPowerBIDataset.Run().returnvaluestring
);

 

Insert a label and set the text property to

ReturnString

 

This verifies the power automate completed or not

Note: Return type updated from boolean to string.


Thanks,
Stalin - Learn To Illuminate

View solution in original post

14 REPLIES 14
StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

Power BI is connected to excel but through a refresh cycle. PowerBIIntegration.Refresh() will refresh the data but from cached data. There is no way to make automated updates when the data source is excel. Power BI Refresh based on your refresh cycle when the data source is not supporting a direct query.

 

The only option is to use Direct Query when building Power BI Report. Here is the MS article for supported data sources for direct queries.

 

Thanks,
Stalin - Learn To Illuminate

 

@StalinPonnusamy I got your point. Thats why I tried using PowerBI.RefreshDataset() to refresh dataset, but does not work. 

 PowerBIIntegration.Refresh() Will work only with Direct Query. 

StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

We need to Reset the Power BI control once the data is updated. Set the OnSuccess property of the form to

Notify("Successful")
Set(ResetPowerBI, false);
PowerBI.RefreshDataSet("me","Dataset GUID");
Set(ResetPowerBI, true);Set(ResetPowerBI, false);

 

And Set the Reset property of Power BI Control to

ResetPowerBI

 

Daniel has a video that discusses specifically this issue. Watch from 11:30 on this video. 

 

I hope this resolves the issue.


Thanks,
Stalin - Learn To Illuminate

 

StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

I have updated the above post for the steps to refresh.


Thanks,
Stalin - Learn To Illuminate

@StalinPonnusamy Thank for your suggestion. 

 

I gave it a try. However, it was the same, not working. It refreshed dataset, not the visual. 

 

tracytran_0-1636769416823.png

My case is  a little bit different with Daniel. I integrate Power Apps into Power BI and he integrates Power BI into Power Apps. Therefore, there is no Power BI Control to refresh the property.

 

I am thinking using Automate in Power Apps to refresh it. I created a flow to refresh Power BI, however, I am new with Power App, I do not know how to trigger a flow in Power App form. Do you have any idea about it?

 

@StalinPonnusamy Thank for your suggestion. 

 

I gave it a try. However, it was the same, not working. It refreshed dataset, not the visual. 

tracytran_0-1636769416823.png

My case is  a little bit different with Daniel. I integrate Power Apps into Power BI and he integrates Power BI into Power Apps. Therefore, there is no Power BI Control to refresh the property.

I am thinking using Flow in Power Apps to refresh it. However, I am now with Power App. You have any idea about it?

 

StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

Then will try to reset Power Bi Dataset using Power Automate.

 

  • Create new Power automate
  • Select Trigger: PowerApps (Like below)

StalinPonnusamy_0-1636770502408.png

 

Flow Steps/Actions:  (My flow Name : ResetPowerBIDataset)

StalinPonnusamy_1-1636770627636.png

 

Call the flow from PowerApps Once the form is submitted successfully

 

Notify("Successful")
ResetPowerBIDataset.Run()

 

 


Thanks,
Stalin - Learn To Illuminate

 

@StalinPonnusamy thank for your prompt reply. 

 

I created the flow as your suggestion: 

 

tracytran_0-1636773952870.png

 

Call the flow from PowerApps Once the form is submitted successfully. However, it raised the error. 

tracytran_2-1636774828326.png

 

I tried the second time with Onsuccess action. It also raised the error. 

tracytran_3-1636774952611.png

 

Do you have any idea where I am missing? @StalinPonnusamy 

StalinPonnusamy
Super User
Super User

Hi @tracytran 

 

 

Looks like the Power Automate is not connected to PowerApps. You may need to close the app and reopen it to connect the newly created Power Automate.

 

  • Insert a button
  • Select the button
  • Click Action on the menu bar
  • Click Power Automate
  • Power automate list will display on the right side
  • Select the Power Automate "ResetPowerBIDataset"

StalinPonnusamy_2-1636776921114.png

 

Change Power Automate return type to text like below

StalinPonnusamy_1-1636776875381.png

 

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,870)