cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FrancoGR
Helper I
Helper I

Resume Gallery in DataTable

Hi. 

 

I have and SP list with 20K records (and increasing...). In a screen I see the details of a selected house using filter with delegation, in a Gallery

FrancoGR_0-1617424906095.png

But i have to show and abstract of the gallery. the times "Habitación" is repeated. In a table:

 

FrancoGR_1-1617425181491.png

Column 1: "Hab."&Distinct value.

Column 2: Times repeates each distinct value

 

Is this possible in PowerApps?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FrancoGR ,

This will sum the NroCrama in each NroHab

AddColumns(
   GroupBy(
      GAL_CASA.AllItems,
      "NroHab",
      "OtherData"
   ),
   "CramaNo",
   Sum(
      OtherData,
      NroCrama
   )
)

You can call the field name I have used CramaNo whatever you want.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

14 REPLIES 14
Ashwin7104
Super User
Super User

Hi @FrancoGR ,

 

Please refer the below link and it should help you to solve your needs.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Distinct-Filter-and-Sort-on-Gallery/td-p/512... 

 

Thanks.

Boynog
Helper II
Helper II

Hi @FrancoGR ,

Use this code.

 

ClearCollect(test1,Distinct(YourDataSource,ColumnOfHabitacion));
ClearCollect(test2,ForAll(test1,CountRows(Filter(YourDataSource,ColumnOfHabitacion=Result))));
Clear(MergeTest);
ForAll(
Sequence(CountRows(test1)),
Collect(MergeTest,
{
ColumnOfHabitacion:First(test1).Result,
count:First(test2).Value
})
);

 Then use the MergeTest as data source to get your needs.

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

WarrenBelz
Super User
Super User

Hi @FrancoGR ,

What are the Items of the Gallery as you are currently filtering them? The GroupBy() function (which is what you need) is not Delegable, so you have to "pre-filter" the output to under 2,000 records with a Delegable filter to achieve the result.

FrancoGR
Helper I
Helper I

@Ashwin7104 , thank you but that is not what I need (already used it to filter the gallery and works fine) 

 

The problem is I can use count, count if formulas with the data source because of the number of records. so i need to count the disctint values in the gallery.

 

Thanks.

Thanks @Boynog , but I have in the same screen a form to add records, so the gallery updates simultaneously and the abstract table should do it too. Using collection "copy" all the register previous to the updates I make in the form.

Hi @WarrenBelz  I use the "pre-filter" in the gallery, That's what I need to count the disctint values in the gallery. 

HI @FrancoGR ,

Assuming you have the data you require in the Gallery, this should get the values you are after. I have assumed the field name here (Habiticon)

AddColumns(
   GroupBy(
      YourGalleryName.AllItems,
      "Habiticon",
      "OtherData"
   ),
   "CountNo",
   CountRows(OtherData)
)

You could also use the GroupBy on the collection that forms the gallery.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz I think it will work, but I have some doubts.

 

The filtered Gallery (GAL_CASA) have the fields NroHab and NroCama so the table has to show the quantity of NroCama are in NroHab (the count of beds in a room in a house)

 

I can get the number counting the distinct values. Where I have to put the formula?

 

Thank you

Hi @FrancoGR ,

This will sum the NroCrama in each NroHab

AddColumns(
   GroupBy(
      GAL_CASA.AllItems,
      "NroHab",
      "OtherData"
   ),
   "CramaNo",
   Sum(
      OtherData,
      NroCrama
   )
)

You can call the field name I have used CramaNo whatever you want.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,146)