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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
markmsc
Advocate II
Advocate II

Using embedded Power App to delete a row in a report datasource

Hello all.  Pretty simple question here, really, but I've not turned up an example solution.  Would be grateful for a pointer.

 

I have a relatively simple Power BI report that displays the content of a database table, with a few filters and such applied.  On the report is an embedded Power App that allows report viewers to edit the database table data, or insert and save a new row if needed.  

 

That is all working fine.  For various reasons, users were not permitted to delete rows from the table so the Power App has never supported that.  This restriction is now removed, so the app must let them delete.

 

The app itself is conceptually similar to the example app laid out in Understand canvas-app forms.  Accordingly, I scrolled down to the Delete a Record section in that document and attempted to do the same thing.  Add a button for Deletes, and then set the OnSelect property to (quoting that document(:

 

Remove( 'Ice Cream', Gallery1.Selected )

 

In this example case from the doc, "Ice Crream" is a SharePoint list.  In my app I am working with a database table that is connected to the from via its DataSource property.  So instead of "Ice Cream", I do, e.g.

 

Remove('schema_name.table_name',Gallery1.Selected)

 

The parser has no issue with me specifying the datasource in there.  Instead, it objects to  me trying to pass in Gallery1.selected, saying: "Incompatible type. The collection can't contain values of this type."

 

So which half of the arguments is my problem here?  Should I be specifying something other than the datasource for the first parameter?  Or something other than Gallery1.Selected for the row that is to be removed from the datasource?

 

(Or should I just skip using Form functions and try to use Patch in the button's OnSelect instead?)

 

Thank you.

1 ACCEPTED SOLUTION
markmsc
Advocate II
Advocate II

Just for completeness, I solved it.  The underlying table is a single-column primary key, identity type.  Accordingly, it wasn't being passed into the app and so I couldn't do anything with it there.  I modfied the report-app definition to incliude the key, and then changed my Remove function in the app to include LookUp by the key:

 

Remove('schema_name.table_name', LookUp('schema_name.table_name', mytableID = Gallery1.selected.mytableID))

 

and that works fine.

 

View solution in original post

3 REPLIES 3
markmsc
Advocate II
Advocate II

Just for completeness, I solved it.  The underlying table is a single-column primary key, identity type.  Accordingly, it wasn't being passed into the app and so I couldn't do anything with it there.  I modfied the report-app definition to incliude the key, and then changed my Remove function in the app to include LookUp by the key:

 

Remove('schema_name.table_name', LookUp('schema_name.table_name', mytableID = Gallery1.selected.mytableID))

 

and that works fine.

 

lbendlin
Super User
Super User

That seems to be more of a PowerApp question - maybe post in their forum? Microsoft Power Platform Community Forum Thread

 

Note: Patch can only update an existing record or create a new one. It cannot delete records.

Yes, my mistake on Patch and also accidentally posting to the wrong place.  I steered here out of habit and didn't even realize it!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors