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 / How to filter rows bas...
Power Apps
Answered

How to filter rows based on 12 hour intervals?

(0) ShareShare
ReportReport
Posted on by 503

Hi all 

 

I am trying to filter some rows based on 12 hour intervals, so after 12am I would like to display rows for AM and after 12pm I would like to display rows for PM. 

 

Filter(SortByColumns(Search('Measurement',TextSearchList_2.Text,"name"),"name",Ascending), 'Measurement (Views)'.'Today Active')

 

Right now I have the relevant rows showing for today and each day they update with 2 new rows ready for AM and PM data but I dont know how to filter them based on AM and PM, or what I would add to the syntax above? 

 

I also have a column that displays AM and PM for each row as seen in the screenshot and a column that displays the current date and time so I think this could help filter AM or PM rows.

 

Thank you for the help! 

ampm.jpg
nowdate.JPG
Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Usernametwice23 :

    Could you please tell me what Measurement is ? Is it a SharePoint list?

    Could you please tell me what 'AM/PM''s datatype is?

    I assume 'AM/PM' is just a text column,please try:

     

    If(
    Value(Text(Now(),"HH"))>=12,
    Filter(SortByColumns(Search('Measurement',TextSearchList_2.Text,"name"),"name",Ascending), 'Measurement (Views)'.'Today Active' && 'AM/PM'="PM"),
    Filter(SortByColumns(Search('Measurement',TextSearchList_2.Text,"name"),"name",Ascending), 'Measurement (Views)'.'Today Active' && 'AM/PM'="AM"),
    )

     

    Best Regards,

    Bof

  • Usernametwice Profile Picture
    503 on at

    Hi @v-bofeng-msft 

    I really appreciate your help. 

     

    Measurement is a dataverse table. 

     

    And AM/PM is a Choices column. 

     

    Would the syntax be any different in this case? 

    Thanks again. I'll give it a go tomorrow. 

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Usernametwice23 :

    If AM/PM is a Choices column,the filter condition should be:

     

    Text(First('AM/PM'.Value).Value)="PM"

     

     If AM/PM is a Choice column,the filter condition should be:

     

    Text('AM/PM')="PM"

     

    Best Regards,

    Bof

     

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
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard