web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using Selected Items i...
Power Apps
Answered

Using Selected Items in a Power BI table w/ Power Apps Gallery

(1) ShareShare
ReportReport
Posted on by
I'm working on a project in which I'm attempting to integrate a Power Apps gallery into a PowerBI report. I have the gallery setup and its populating in the PowerBI report correctly with the items I want to display. The function of the gallery is to display a list of account numbers that the user has selected on the PowerBI table. Eventually, the selected account numbers will need to be carried into a Power Apps form where the user can edit and save the info into the SharePoint back-end.

The trouble I'm running into is selection. I want the Power Apps gallery to appear blank if nothing is selected in the PowerBI table by the user. Currently, upon start, the embedded gallery will display all account numbers in the associated PowerBI table. I want to make it so the integrated Power Apps gallery is completely blank and will ONLY show items selected in the PowerBI table when/if they are selected. So, my first question is how I would accomplish that particular feat.

Secondly, I'm having trouble using the 'SelectedItems' function with the 'PowerBIIntegration.Data' and it seems I can't rely on a formula such as "CountRows(PowerBIIntegration.Data.SelectedItems)=0" to indicate when a button should be disabled or enabled. Furthermore, I was hoping to use SelectedItems to forward the rows selected in the PowerBI tables to the Power App forms for editing. So, second question is if there's a way to use SelectedItems with the PowerBIIntegration.Data. If not, is there a workaround for when I have to carry those PowerBI table selected items forward into the forms? 

Thanks in advance for any assistance.
Categories:
I have the same question (0)
  • Verified answer
    MParikh Profile Picture
    480 Super User 2026 Season 1 on at

    🔍 Why you're seeing all records:

    By default, PowerBIIntegration.Data shows all the records from the Power BI table when:
    • Nothing is selected.
    • The Power BI visual is passing the entire dataset into Power Apps.
    ✅ Solution: Filter gallery to only show records when something is selected
     
    // Gallery's Items property
    If(CountRows(PowerBIIntegration.Data) = CountRows(YourSourceTable),[], 
    // Show blank
     if no filter is appliedPowerBIIntegration.Data)
     
    🔧 How this works:
    • When nothing is selected in Power BI, PowerBIIntegration.Data contains the entire dataset.
    • So we compare its row count to the full table (YourSourceTable, e.g. Accounts or a SharePoint list).
    • If they're the same, that means no filters/selections were applied, so show nothing.
    • Otherwise, show the selected rows.
       

    🔍 Why SelectedItems doesn't work:

    • PowerBIIntegration.Data is a table — not a control.
    • SelectedItems is available on gallery controls or list controls, but not on PowerBIIntegration.Data because it’s not interactive inside the app.
    • You can't directly say PowerBIIntegration.Data.SelectedItems.
    ✅ Solution: Use CountRows(PowerBIIntegration.Data) but with baseline comparisonSame trick as above:
     
    // Button's DisplayMode property
    
    If(CountRows(PowerBIIntegration.Data) = CountRows(YourSourceTable);
    DisplayMode.Disabled,DisplayMode.Edit)
    You can also store this logic in a variable:
    // OnVisible of the screen
    Set(IsFiltered,CountRows(PowerBIIntegration.Data) <> CountRows(YourSourceTable));
    Then for the gallery:
    If(IsFiltered, PowerBIIntegration.Data, [])
    And for the button:
    If(IsFiltered, DisplayMode.Edit, DisplayMode.Disabled)

    Forwarding selected rows to a Power Apps form

    Since you can't use SelectedItems, the trick is to:

    Wrap the selected data into a collection

     

     

    // OnVisible or a button clickClearCollect(colSelectedAccounts,PowerBIIntegration.Data)

    Now use colSelectedAccounts as your gallery Items or patch target.

    If you want to pass one selected account to a form:

     

     

    // e.g. when navigating to the form screenSet(selectedAccount, First(colSelectedAccounts));Navigate(frmEditScreen, ScreenTransition.None);

    On your form:

    • Set Item to selectedAccount

    • OnSave: Patch to SharePoint using selectedAccount.ID

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard