Introduction

This article explores how to enhance PowerApps with interactive features. Learn to synchronize column chart selections to filter galleries seamlessly for a more dynamic user experience.

Filter PowerApps Gallery with Column Chart Selection

Steps

1. Setup

Assume that we have a "Project Details" list as the main list and a "Status Count Tracker" list tracking the count of the status with each project in SharePoint.

Filter PowerApps Gallery with Column Chart Selection

2. Prepare PowerApps

Add a new screen in PowerApps. Add the below code to the “OnVisible” property of the screen.

Clear(colStatusData);
ForAll(
    'Status Count Tracker',
    Collect(
        colStatusData,
        {
            Title: Title,
            StatusCount: StatusCount
        }
    )
);
Set(
    varSelectedStatusTitle,
    "Total"
)

3. Enhance X Axis Labels

Filter PowerApps Gallery with Column Chart Selection

4. Implement Column Chart Selection

Add the following code to the “OnSelect” property of ColumnChart:

Set(
    varSelectedStatusTitle,
    LookUp(
        'Status Count Tracker',
        StatusCount = ColumnChart.Selected.StatusCount && Title = ColumnChart.Selected.Title
    ).Title
);

5. Create Filtered Gallery

If(
    varSelectedStatusTitle = "Total",
    'Project Details',
    varSelectedStatusTitle = "Open",
    SortByColumns(Filter('Project Details', Status = "Open"), "Created", SortOrder.Descending),
    varSelectedStatusTitle = "InProgress",
    SortByColumns(Filter('Project Details', Status = "InProgress"), "Created", SortOrder.Descending),
    varSelectedStatusTitle = "Closed",
    SortByColumns(Filter('Project Details', Status = "Closed"), "Created", SortOrder.Descending)
)

6. Inside Configure Gallery Labels

Filter PowerApps Gallery with Column Chart Selection

By following these steps, you can effectively synchronize column chart selections with filter galleries in PowerApps, offering users a more interactive and dynamic experience.

Enjoy Learning!