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 value from multipl...
Power Apps
Answered

Add value from multiple rows which match criteria

(0) ShareShare
ReportReport
Posted on by 4

I'm trying to add multiple tasks which match date and serial number. UI looks something like below.

Capture.PNG

First, you need to input start date, end date, and serial number. Then, it'll calculate date range between two date as on the right of the picture. Finally, I need to pull tasks and max ot with match criteria next to the date.

Capture.PNG

This is my sample data. If I search with criteria startDate=1/9/21, endDate=30/9/21, and S/N=FB/6, I will get tasks_ID=13,14,15 (within the same record) and OT=7.50.

 

Any suggestions are welcom.

 

Thanks,

FakeHungry

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @FakeHungry 

     

    Set the OnSelect property of the Search button to

    ClearCollect(
     ColTasksH,
     Sort(
     Filter(
     TasksH,
     Request_Date >= StartDateH.SelectedDate && Request_Date <= EndDateH.SelectedDate && 'Vehicle_S/N' = SNSearch.Text
     ),
     OT,
     Descending
     )
    )

     

     Set the text property of Label to

    First(ColTasksH).Task_ID

     

  • FakeHungry Profile Picture
    4 on at

    Hi @StalinPonnusamy 

     

    Thanks for your suggestion, but it didn't work. The result should be as table below.

    FakeHungry_0-1634436628015.png

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

    Hi @FakeHungry 

     

    ClearCollect(
     ColTasksH,
     GroupBy(
     Sort(
     Filter(
     [@TasksH],
     Request_Date >= StartDateH_1.SelectedDate && Request_Date <= EndDateH_1.SelectedDate && 'Vehicle_S/N' = SNSearch_1.Text
     ),
     OT,
     Descending
     ),
     "Request_Date",
     "RequestDateTable"
     )
    );
    ForAll(
     ColTasksH,
     Collect(
     ColTasksHNew,
     {
     Request_Date: ThisRecord.Request_Date,
     OT: First(ThisRecord.RequestDateTable).OT,
     Task_ID: Concat(ThisRecord.RequestDateTable,Task_ID,",")
     }
     )
    )

    StalinPonnusamy_0-1634478315495.png

    Source

    StalinPonnusamy_1-1634478405011.png

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard