cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JohannSteyn
New Member

Write calculated PowerBI column back to database automatically

Hi all,

(I'm new to this forum)

 

I want to build a PowerApp to simply write back a calculated column in PowerBI to our database. (I understand I need to use PowerApps - that's why I'm new here), but it looks like manual intervention is needed with PowerApps (i.e. a user must click submit before the data is written to the database).

 

Does anyone have an idea on how to automatically write back "submit" calculated columns to the database on a schedule (this seems like a very simple task but I have spent the last 7 hours searching for a solution)


Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

HI @JohannSteyn,

Which data based do you want to write back?

Do you want to write back a calculated column in PowerBI to a database like excel or SharePoint?

 

Firstly, you should open the report in Edit mode in Power BI service and click on the Power App visual.

1). First select the fields you want to make available to the app

2). Always create a new app or use an app that you have previously created from Power BI service. Here I suggest you create a new app

3). Create a new app and in Power Apps Studio, take a look at what is created for you. On top of Screen1, you see PowerBIIntegration. 

vqiaqimsft_0-1655451447694.png

4). Add a second screen to edit selected items from the Galley. Go to the Home tab and click on New Screen and choose Form.

A form has two important properties:

  • Data Source: This is the table that will get updated. Even though the fields are already coming from the Power BI report, you must connect the form to your database like SQL data source for it to be able to write changes back to the table
  • Item: This is where the form gets its fields populated from. Here you should set it as Gallery1.Selected

5). So far we have a form that is showing the selected item from the Gallery. Once the data is saved, we want the app to refresh the Power BI report and the app to navigate to the first screen. Modify the OnSelect property to look like this.

SubmitForm(EditForm1);PowerBIIntegration.Refresh();Navigate(Screen1);
Best Regards,
Qi

View solution in original post

1 REPLY 1
v-qiaqi-msft
Community Support
Community Support

HI @JohannSteyn,

Which data based do you want to write back?

Do you want to write back a calculated column in PowerBI to a database like excel or SharePoint?

 

Firstly, you should open the report in Edit mode in Power BI service and click on the Power App visual.

1). First select the fields you want to make available to the app

2). Always create a new app or use an app that you have previously created from Power BI service. Here I suggest you create a new app

3). Create a new app and in Power Apps Studio, take a look at what is created for you. On top of Screen1, you see PowerBIIntegration. 

vqiaqimsft_0-1655451447694.png

4). Add a second screen to edit selected items from the Galley. Go to the Home tab and click on New Screen and choose Form.

A form has two important properties:

  • Data Source: This is the table that will get updated. Even though the fields are already coming from the Power BI report, you must connect the form to your database like SQL data source for it to be able to write changes back to the table
  • Item: This is where the form gets its fields populated from. Here you should set it as Gallery1.Selected

5). So far we have a form that is showing the selected item from the Gallery. Once the data is saved, we want the app to refresh the Power BI report and the app to navigate to the first screen. Modify the OnSelect property to look like this.

SubmitForm(EditForm1);PowerBIIntegration.Refresh();Navigate(Screen1);
Best Regards,
Qi

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 (4,435)