cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Filtering large dataset, delegation warning for multi-choice column

I have a help desk gallery connected to a large SharePoint list, over 2000 items. I'm trying to filter it based on my Choices column called Location, but I'm getting a delegation warning. My goal is to use a Dropdown box to let users filter the gallery.  The formula on the Items property of the gallery that comes closest is 
     Filter('Service Request List', Location = Dropdown1.Selected.Value.Text)

 

but I still get the delegation warning. We have 50 locations, and my SharePoint list Location column accepts multiple values. So I can't use the Distinct function. I also can't use the In function because the list is over 500 records. Any other ideas?  

 

I saw a suggestion somewhere of trying to add another filter to the filter, but many of our fields are choice-based, and Location is the primary way users would search for existing tickets at their site. Maybe I could filter by Location plus any ticket less than a month old, but I'm not sure how to write the formula for both of these. 

1 ACCEPTED SOLUTION

Accepted Solutions
Amik
Super User
Super User

@OneWinPlease - I was not being clear in my post.

The key point is that comparing a Date Only field with a DateTime field is not delegable because they are different data types. If your Date field is a DateTime then use Now() instead of Today():

 

With(
    {
        _previous_30_days: DateAdd(
            Now(),
            -30,
            TimeUnit.Days
        )
    },
    With(
        {
            _pre_filtered_data: Filter(
                'Your List',
                YourDateTimeColumn >= _previous_30_days
            )
        },
        Filter(
            _pre_filtered_data,
            Len(ComboBox1.Selected.Value) = 0 || ComboBox1.Selected.Value in 'Your Multi Choice Column'.Value
        )
    )
)

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

View solution in original post

12 REPLIES 12

If you use choice columns, you're going to have a bad time with delegation. I would recommend creating a calculated column based on your choice's text. If I ever feel the itch to create a choice column, I create a separate table or I will create a collection in the App.Formulas space. 

 

I hope that helps! 😊👍

 

https://youtu.be/5mHjbzQefcw?si=LmlP9PlgRj75Rxlv
___NOcHOICE.jpg


Darren Neese, Power Apps MVP
➡️Get access to my free Power Apps crash course here: https://go.superpowerlabs.co/superlanding


If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up. 😊👍👍


Amik
Super User
Super User

@OneWinPlease - 

 

You're correct in that you will need to pre-filter your list with the delegable Filter function. As long as you can be certain that your filtered data will return less than 500 rows (or max 2000 if changed via settings), you can safely run your non-delegable operation on that smaller subset of data.

 

In your scenario, you will need to be certain that filtering your data within the last month will return less than 2000 rows.

 

For example, we can leverage the With function to return a data within the last 30 days of a Date column, and then apply the non-delegable In function on that filtered subset. 

 

With(
    {
        _previous_30_days: DateAdd(
            Today(),
            -30,
            TimeUnit.Days
        )
    },
    With(
        {
            _pre_filtered_data: Filter(
                'Your List',
                YourDateColumn >= _previous_30_days
            )
        },
        Filter(
            _pre_filtered_data,
            Len(ComboBox1.Selected.Value) = 0 || ComboBox1.Selected.Value in 'Your Multi Choice Column'.Value
        )
    )
)

 

 

Notes:

 

  • Although your Choice field in your SharePoint list is set to multi-select, the above assumes your ComboBox control is set to single-select.

  • Your Date column must be Date only. The above is not be delegable on a DateTime data type.

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

@Amik  thank you for your reply.  As the list grows, with 50 locations potentially putting in tickets over time, a pre-filtered filter wouldn't return less than 500 rows for very long, I'm afraid. Your point about the Date column means I would have to change its format, as currently it has the time as well, but that shouldn't be a big deal. (famous last words).  I sure appreciate you taking the time to write out a formula for me.

@developermct , thanks - I will watch your video. I don't know how to do the things you mentioned and will be glad to learn.

@OneWinPlease - this comment of yours seems to suggest you will return less than 500 rows if you pre-filter your list for records less than a month old...

 

"Maybe I could filter by Location plus any ticket less than a month old"

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Yes, you're right @Amik  - I think at the end of a work week I wasn't thinking clearly when I responded. (I was doubtful I could "guarantee" anything.)  I will try your formula on Monday and report back here!

@Amik , for various reasons I can't make the Date/Time column just Date. I don't think I have another column in this list that wouldn't eventually exceed 500 items. (I thought about the Status column but next year some of my locations could very well have more than 500 rows for "completed" status.)  So I am back to square one. I may just create a view that is not filtered, and let users see all tickets put in at any time. 

Amik
Super User
Super User

@OneWinPlease - I was not being clear in my post.

The key point is that comparing a Date Only field with a DateTime field is not delegable because they are different data types. If your Date field is a DateTime then use Now() instead of Today():

 

With(
    {
        _previous_30_days: DateAdd(
            Now(),
            -30,
            TimeUnit.Days
        )
    },
    With(
        {
            _pre_filtered_data: Filter(
                'Your List',
                YourDateTimeColumn >= _previous_30_days
            )
        },
        Filter(
            _pre_filtered_data,
            Len(ComboBox1.Selected.Value) = 0 || ComboBox1.Selected.Value in 'Your Multi Choice Column'.Value
        )
    )
)

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Ah ok, @Amik  - thanks for clarifying. May I ask one more thing: is your expression _pre_filtered_data: actually the real expression here?  I don't want to assume but, if I replace my list, my date/time column, and the name of my two comboxes, I should use everything else in your formula verbatim?

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (925)