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 / PowerApps - Filter by ...
Power Apps
Unanswered

PowerApps - Filter by Date greater than Today-30

(0) ShareShare
ReportReport
Posted on by 89

Hi everyone.

In my PowerApps application, i'm pulling from Oracle some records into my DataTable. Once of the columns is the " STRT_DTT" for the Start date. The format of that field is: "Saturday, March 20, 2021 04:30:00 AM".
My goals is to be able to filter the records based on that file. I need to filter all records where STRT_DTT is >= Today(),-31,Days.

Bot for some reason, it does not work.
Last thing I've tried was:

(Text(STRT_DTT,DateTimeFormat.LongDate) >= Text(Today(),DateTimeFormat.LongDate)-31)

 

I have also tested below, but still not pulling any records.

I've created a new Textbox called: tx30DaysAgo
The default field equals to below code:

Text(DateAdd(DatePicker1_2.SelectedDate,-30,Days),DateTimeFormat.LongDateTime)

That gives me the same format and -30 days, it equals to: "Thursday, February 18, 2021 12:00:00 AM"

Now i update the data query with:

STRT_DTT > Value(tx30DaysAgo.Text)

 

But nothing, no results what so ever, and without any errors.

 

Can you please help me? Thank you

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    I believe the problem is that your use of Text() turns the values into text strings rather than DateTime Values.  YOu shoudl try using a simple filter like

    Filter(datasource,STRT_DTT<= DateAdd(DatePicker1_1.SelectedDate,-31))

    If the condition complains that STRT_DTT is text then enclose STRT_DTT in a DateTimeValue() function.

  • Wilder1626 Profile Picture
    89 on at

    Thanks for your help. 

    I've tested below. I don't have any error but still no records. Kind of weird.

     

    Sort(
    Filter(
    '[APIBATCH_QUE_T]',
    STRT_DTT> DateAdd(DatePicker1_1.SelectedDate,-31)
    ),
    STRT_DTT,
    Descending
    )

     

    I also see that "DateAdd(DatePicker1_2.SelectedDate,-31)" format is the same as what i see in the STRT_DTT column.

     

    DateTime fileter powerapps.jpg

  • Wilder1626 Profile Picture
    89 on at

    I don't know if this tells you something, but i may have an error:

    error date time.jpg

  • Wilder1626 Profile Picture
    89 on at

    If i do something like: STRT_DTT < STRD_DTT, that works since. I guess that since both columns had the same formats, it does it. 

     

    But if i do: STRT_DTT> DateAdd(DatePicker1_1.SelectedDate,-31), That does not work at all.

     

    So probably that i need to find the real STRT_DTT format.

    In the Data Table STRT_DTT column Text field, i see: Text(ThisItem.STRT_DTT,DateTimeFormat.LongDateTime)

  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    As I mentioned.  If it doesn't work using STRT_DTT you may have to enclose it in DATETimeValue() to make sure its evaluated as a Date.

  • Wilder1626 Profile Picture
    89 on at

    Sorry, i'm brand new on PowerApps since the last 2 weeks. I had to search on google for some DataTimeValue samples.  So am I on the right track when i say below?

    DateTimeValue(Text(STRT_DTT,"[$-en-US]dd-mm-yyyy hh:mm:ss"),"en-US") 

  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    Yes, that should change the data type back from a string to a DateTime.  That can then be used to filter with the DateAdd()

  • Wilder1626 Profile Picture
    89 on at

    Thanks for confirming.

     

    I've done the update now, but I suddenly have a "Delegation warning. This part "Filter" of this formula might not work correctly on large data sets." Also it does not give me any results.

     

    Text( STRT_DTT, "[$-en-US]dd-mm-yyyy hh:mm:ss" ) ) > DateAdd( DatePicker1_2.SelectedDate, -31 );

     

     

  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    Whenever you start modifying the left side of the condition you are going to get a delegation warning.  The only way to avoid that is to use STRT_DTT by itself as a column.  But you said that doesn't work.  I'm not familiar enough with Oracle to be able to tell you why.  But to do the filter you want you have to be evaluating two DateTime variables.

  • Wilder1626 Profile Picture
    89 on at

    It make sense to me. Will continue to look at it, and will let you know you if any progress.

    Thanks again for your help. I've learned new things today.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard