Problem Statement

I have a SharePoint List and I am attempting to take that data, pivot it, and apply style/formatting. I determined that PowerApps would be the ideal solution for achieving this, but am at a loss for how to design/implement this in PowerApps.

Example Data

Category Name Description
A Frank Lorem
A John Ipsum
B Sally Doler
C Lea Sit
C James Amet

Desired Output in PowerApps

Frank Sally Lea
John James

Where I have pivoted the Category column into a horizontal row (that expands/contracts according to the data), and the name is able to appear correctly under the respective category (Description field would be in the detail view after clicking on the appropriate name).

The desired output is shown in a table, but that is just the best way to communicate the desired layout structure. I don't know whether this type of structure is best suited for data table, gallery, mix of horizontal/vertical containers, or something else entirely.

What is the best way to perform this data transformation and apply it into a PowerApps layout?

3 Answers 3


Going with your child gallery approach, I came up with this:

enter image description here

  1. I created a collection of your sample data called collItems

  2. My Parent gallery gallCategories has this formula for the items: Distinct(collItems,Category).Result, a label with ThisItem.Result for the text and has a Wrap Count of 3.

  3. The child gallery formula is: Filter(collItems,Category = ThisItem.Result) and obviously has a label for the name and description fields.


I doubt you can build that in a single structure in PowerApps. But you can use three galleries side by side, one for A, one for B, one for C. The first gallery filters the data for all items where Category = A, the next one shows Category = B, etc. The formula for the gallery items would be along the lines of


If it's a Choice column, you need to adjust accordingly.

Selecting an item in the gallery can then pop up a form that shows the details of the selected gallery item. For example OnSelect, set a variable "varShowForm" to True, set a variable varSelectedID to GalleryA.Selected.ID. The form is visible when varShowForm is true and the form item is Filter(SharePointList,ID=varItemID).

There are about three dozen different ways to do the latter, but that's the gist of it.

  • The problem is the actual data is much larger, and does not allow for hardcoding the horizontal column names. After some research it seems a nested gallery might do the trick, and I can get the Category going horizontally simply enough through a GroupBy on the parent gallery, but I cannot seem to get the child gallery to be able to filter according to the parent's category
    – Moses
    Nov 22, 2021 at 23:17

Use groupby(list, "dept", "recordsfordept") then creatively show that collection in a horizontal gallery and use the recordsfordept collection in the gallery within each element of that gallery.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.