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 / Created Field & filter...
Power Apps
Answered

Created Field & filtering for last 3 months

(2) ShareShare
ReportReport
Posted on by 557
I don't have a date filter/picker.  I'd like to just filter a gallery for items in the last three months.  (essentially if today is 11/14/2023, I only want to see items from 8/14/2023-11/14/2023).  Any help is appreciated.   (Using the Created field coming from SharePoint)
 
 
 
 
With(
    {
        _prefiltered_data: Filter(
            'eCom Intake',
           
            Status.Value = "Resolved",
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at
    It should be something like this - note that the extra With() statement at the top is for Delegation management

    With(
      {
          _prefiltered_data:
      With( { _Limit: DateAdd( Today(), -3, TimeUnit.Months ) }, Filter( 'eCom Intake', Status.Value = "Resolved" && Created >= _Limit ) },

      . . . . .

     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • Suggested answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 1 on at
    Hi joel914823,
     
    You can try the following:
    With(
        {
            _prefiltered_data: Filter(
                'eCom Intake',
                Status.Value = "Resolved" &&
                Created >= DateAdd(Today(), -3, Months)
            )
        }
    ...
     
    Hope this helps you. 
  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
    pls try the following:
     
    With(
        {
            _prefiltered_data: Filter(
                'eCom Intake',
                Status.Value = "Resolved" && Created >= DateAdd(Today(), -3, Months)
            )
        },
        _prefiltered_data
    )
     
    Set the Items property of your gallery to _prefiltered_data within the With block as shown
  • Suggested answer
    ShaileshP Profile Picture
    31 on at
    Below is simple way to achieve it...
     
    Assuming your SharePoint list is named MySharePointList and contains a Created field:
    1. Calculate the Date Three Months Ago:
       Set(
           ThreeMonthsAgo,
           DateAdd(Today(), -3, Months)
       );
       
    2. Set the Items Property of the Gallery:
       Filter(
           MySharePointList,
           Created >= ThreeMonthsAgo
       )
      
    Add your custom filters of status and other values in point 2 above...


    If you need it for your code above, then you can also use the below step:

    With(
        {
            // Calculate the date three months ago
            _threeMonthsAgo: DateAdd(Today(), -3, Months),
            // Filter the data by Status and Created fields
            _prefiltered_data: Filter(
                'eCom Intake',
                Status.Value = "Resolved" && Created >= _threeMonthsAgo
            )
        },


        // Set the Items property of a Gallery
        GalleryName.Items = _prefiltered_data
    )

  • joel914823 Profile Picture
    557 on at
    Hello @WarrenBelz, here is entire one, but it seems I'm doing something wrong after the filter step?  

    With(
        {_prefiltered_data:
            With(
                {
                    _Limit:
                    DateAdd(
                        Today(),
                        -3,
                        TimeUnit.Months
                    )
                },
            Filter(
                'eCom Intake',
                Status.Value = "Resolved",
                Len(Dropdown4.Selected.Value) = 0 || LOB.Value = Dropdown4.Selected.Value,
                Len(Dropdown4_1.Selected.Value) = 0 || 'Issue Type'.Value = Dropdown4_1.Selected.Value,
                !Checkbox1.Value || 'Created By'.Email=User().Email
            )
        },
        With(
            {
                _transformed_data: AddColumns(
                    _prefiltered_data,
                    TextID,
                    Text(ID),
                    CreatedByDisplayName,
                    'Created By'.DisplayName,
                    AssignedToDisplayName,
                    AssignedTo.DisplayName,
                    ChoiceString,
                    'NeedMoreInfoOPS - Current'.Value
                )
            },
            With(
                {
                    _filtered_by_names: Search(
                        _transformed_data,
                        SearchInput_tb.Text,
                        Title,
                        CreatedByDisplayName,
                        AssignedToDisplayName
                    ),
                    _filtered_by_id: Search(
                        _transformed_data,
                        SearchInput_tb.Text,
                        TextID
                    )
                },
                With(
                    {
                        _finaltable: If(
                            !SearchID_tg.Checked && !SearchRequestor_tg.Checked,
                            _filtered_by_names,
                            _filtered_by_id
                        )
                    },
                    SortByColumns(
                        _finaltable,
                        "ChoiceString",
                        SortOrder.Descending,
                        "ID",
                        SortOrder.Descending
                    )
                )
            )
        )
    )
  • Verified answer
    WarrenBelz Profile Picture
    156,110 Most Valuable Professional on at
    Yes - you are missing a closing bracket - the Filter needs to be indented one more step. You have also defined _Limit and then not used it (I have added as per previous post)
    With(
       {
          _prefiltered_data:
          With(
             {
                _Limit:
                DateAdd(
                   Today(),
                   -3,
                   TimeUnit.Months
                )
             },
             Filter(
                'eCom Intake',
                Status.Value = "Resolved",
                Len(Dropdown4.Selected.Value) = 0 || LOB.Value = Dropdown4.Selected.Value,
                Len(Dropdown4_1.Selected.Value) = 0 || 'Issue Type'.Value = Dropdown4_1.Selected.Value,
                !Checkbox1.Value || 'Created By'.Email = User().Email,
    Created >= _Limit )
    ) }, With( { _transformed_data: AddColumns( _prefiltered_data, TextID, Text(ID), CreatedByDisplayName, 'Created By'.DisplayName, AssignedToDisplayName, AssignedTo.DisplayName, ChoiceString, 'NeedMoreInfoOPS - Current'.Value ) }, With( { _filtered_by_names: Search( _transformed_data, SearchInput_tb.Text, Title, CreatedByDisplayName, AssignedToDisplayName ), _filtered_by_id: Search( _transformed_data, SearchInput_tb.Text, TextID ) }, With( { _finaltable: If( !SearchID_tg.Checked && !SearchRequestor_tg.Checked, _filtered_by_names, _filtered_by_id ) }, SortByColumns( _finaltable, "ChoiceString", SortOrder.Descending, "ID", SortOrder.Descending ) ) ) ) )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard