cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

how to Filter the first id each Group after applying Group by

Hi all,

 

any one please suggest the formula to filter the  first id iof Each group after applying the Group by.

 

Source Table:

Id   ,  Value

101,AST

106,AST

114,AST

126,Bottle

129,Bottle,

130,Nike,

142,Nike

 

Filter Table Should be:

 

101,AST

126,Bottle

130,Nike

 

Please proivide any solution to achieve this.

 

 

 

3 REPLIES 3
Mike8
Memorable Member
Memorable Member

Hello,

I think that it can be improved but the following expression can solve your issue..
Gallery1.Items = ForAll(Distinct(A,Value),LookUp(A,Id=Min(Filter(A,Value=Result),Id)))

Meneghino
Community Champion
Community Champion

Here is a suggestion that only requires reading the source table once:

 

AddColumns(
    GroupBy(
        SourceTable,
        "Value",
        "AllRows"
        ),
    "MinId",
    Min(AllRows, Id)
    )

 The result will contain the AllRows column, but this can be ignored.

Mike8
Memorable Member
Memorable Member

I think Meneghino's solution is better. You should use that one.
You can use the DropColumns() function to get rid of the AllRows column if you want to.

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 (2,156)