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 / Add Another Filter gro...
Power Apps
Answered

Add Another Filter groupby

(0) ShareShare
ReportReport
Posted on by Super User 2024 Season 1

Hi All,

 

I am trying to add my currant groupby formula to another filter an alphabetical gallery, when pressed to show only the clicked alphabet, please 



LastN(
 FirstN(
 Sort(
 AddColumns(
 GroupBy(
 AddColumns(
 Filter(
 'Check Management',
 StartsWith(
 'Business Name',
 SearchText_22.Text
 ),
 (Status.Value = ControlComboBox_11.Selected.Value) 
 // 'Date due' =drpDueCheckfront.SelectedDate
 ),
 "Companyvalue",
 'Business Name'
 ),
 "Companyvalue",
 "NewGroup"
 ),
 "SumShippingFee",
 Sum(
 NewGroup,
 amount
 ),
 "TotalCOD",
 Sum(
 NewGroup,
 amount
 ),
 "Status",
 First(
 Sort(
 NewGroup,
 Status.Value,
 Descending
 )
 ).Status.Value,
 "Email",
 First(
 Sort(
 NewGroup,
 Emails,
 Descending
 )
 ).Emails,
 "ID",
 First(
 Sort(
 NewGroup,
 ID,
 Descending
 )
 ).ID,
 
 "Comments",
 First(
 Sort(
 NewGroup,
 Note,
 Descending
 )
 ).note,
 "Modified",
 First(
 Sort(
 NewGroup,
 Modified,
 Descending
 )
 ).Modified,
 "CheckDuedate",
 First(
 Sort(
 NewGroup,
 'Date due',
 Descending
 ).'Date due'
 ),
 "OrderDatesFull",
 First(
 Sort(
 NewGroup,
 Created,
 Descending
 )
 ).Created,
 "Pending Invoices",
 CountRows(NewGroup),
 "Check Number",
 First(
 Sort(
 NewGroup,
 'Check Number',
 Descending
 )
 ).'Check Number'
 ),
 OrderDatesFull,
 Descending
 ),
 drpPaginationSize_5.Selected.Value * varPageNumber
 ),
 If(
 icoNextPage_3.DisplayMode = Disabled,
 drpPaginationSize_5.Selected.Value - (drpPaginationSize_5.Selected.Value * varPageNumber - CountRows('Check Management')),
 drpPaginationSize_5.Selected.Value
 )
)

 

 

 

 

Captureordmer.PNG

 

 

 

Thank you 

 

 

 

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

     

    Could you tell me:

    Which column do you want to filter?

     

    Due to lack of conditions, please try a similar formula.

    Filter(
    LastN(
     FirstN(
     Sort(
     AddColumns(
     GroupBy(
     AddColumns(
     Filter(
     'Check Management',
     StartsWith(
     'Business Name',
     SearchText_22.Text
     ),
     (Status.Value = ControlComboBox_11.Selected.Value) 
     // 'Date due' =drpDueCheckfront.SelectedDate
     ),
     "Companyvalue",
     'Business Name'
     ),
     "Companyvalue",
     "NewGroup"
     ),
     "SumShippingFee",
     Sum(
     NewGroup,
     amount
     ),
     "TotalCOD",
     Sum(
     NewGroup,
     amount
     ),
     "Status",
     First(
     Sort(
     NewGroup,
     Status.Value,
     Descending
     )
     ).Status.Value,
     "Email",
     First(
     Sort(
     NewGroup,
     Emails,
     Descending
     )
     ).Emails,
     "ID",
     First(
     Sort(
     NewGroup,
     ID,
     Descending
     )
     ).ID,
     
     "Comments",
     First(
     Sort(
     NewGroup,
     Note,
     Descending
     )
     ).note,
     "Modified",
     First(
     Sort(
     NewGroup,
     Modified,
     Descending
     )
     ).Modified,
     "CheckDuedate",
     First(
     Sort(
     NewGroup,
     'Date due',
     Descending
     ).'Date due'
     ),
     "OrderDatesFull",
     First(
     Sort(
     NewGroup,
     Created,
     Descending
     )
     ).Created,
     "Pending Invoices",
     CountRows(NewGroup),
     "Check Number",
     First(
     Sort(
     NewGroup,
     'Check Number',
     Descending
     )
     ).'Check Number'
     ),
     OrderDatesFull,
     Descending
     ),
     drpPaginationSize_5.Selected.Value * varPageNumber
     ),
     If(
     icoNextPage_3.DisplayMode = Disabled,
     drpPaginationSize_5.Selected.Value - (drpPaginationSize_5.Selected.Value * varPageNumber - CountRows('Check Management')),
     drpPaginationSize_5.Selected.Value
     )
    ),
    StartsWith(your column in table,your gallery.selected.columnValue))

    // The code I added is in the first and last line.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xiaochen-msft 

    Title 

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramole ,

     

    So, does my formula work properly in your environment?

    If your Title column is nested in the table, you could try this formula.

    LastN(
     FirstN(
     Sort(
     AddColumns(
     GroupBy(
     Filter( AddColumns(
     Filter(
     'Check Management',
     StartsWith(
     'Business Name',
     SearchText_22.Text
     ),
     (Status.Value = ControlComboBox_11.Selected.Value) 
     // 'Date due' =drpDueCheckfront.SelectedDate
     ),
     "Companyvalue",
     'Business Name'
     ),StartsWith(Title,your gallery.selected.columnValue)),
     "Companyvalue",
     "NewGroup"
     ),
     "SumShippingFee",
     Sum(
     NewGroup,
     amount
     ),
     "TotalCOD",
     Sum(
     NewGroup,
     amount
     ),
     "Status",
     First(
     Sort(
     NewGroup,
     Status.Value,
     Descending
     )
     ).Status.Value,
     "Email",
     First(
     Sort(
     NewGroup,
     Emails,
     Descending
     )
     ).Emails,
     "ID",
     First(
     Sort(
     NewGroup,
     ID,
     Descending
     )
     ).ID,
     
     "Comments",
     First(
     Sort(
     NewGroup,
     Note,
     Descending
     )
     ).note,
     "Modified",
     First(
     Sort(
     NewGroup,
     Modified,
     Descending
     )
     ).Modified,
     "CheckDuedate",
     First(
     Sort(
     NewGroup,
     'Date due',
     Descending
     ).'Date due'
     ),
     "OrderDatesFull",
     First(
     Sort(
     NewGroup,
     Created,
     Descending
     )
     ).Created,
     "Pending Invoices",
     CountRows(NewGroup),
     "Check Number",
     First(
     Sort(
     NewGroup,
     'Check Number',
     Descending
     )
     ).'Check Number'
     ),
     OrderDatesFull,
     Descending
     ),
     drpPaginationSize_5.Selected.Value * varPageNumber
     ),
     If(
     icoNextPage_3.DisplayMode = Disabled,
     drpPaginationSize_5.Selected.Value - (drpPaginationSize_5.Selected.Value * varPageNumber - CountRows('Check Management')),
     drpPaginationSize_5.Selected.Value
     )
    )

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @v-xiaochen-msft 

    not working your formula 

     

     

     

     

     

     

  • Verified answer
    Ramole Profile Picture
    Super User 2024 Season 1 on at

    This the code used to resolve 

    Filter(
     If(
     galAlphapetCustomers.Selected.Value = "All",
     Customers,
     Filter(
     Customers,
     StartsWith(
     Company,
     galAlphapetCustomers.Selected.Value
     )
     )
     ),
     InpSearchCustomerMain.Text in Company || InpSearchCustomerMain.Text in Name
    )

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard