cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlexJohn
New Member

Weird behaviour when using Filter + Distinct against a SharePoint list

Hello,

 

I am using this formula in a dropdown element:

 

SortByColumns(Distinct(Filter(Wochenbericht;(KWNummer<=varKWN));KWNummer);"Result";Descending)

 

varKWN is the current weeknumber and I define it like

 

Set(varKWN;ISOWeekNum(Today()))

 

It has the correct value. The sharepoint I use to get data has around 7000 entries with pretty much all weeknumers (multiple).

 

When I use the formula above, I only get the weeknumers between 1 and 8. So it is missing some. When I change the formula to 

 

SortByColumns(Distinct(Filter(Wochenbericht;(KWNummer=varKWN));KWNummer);"Result";Descending)

I do get the weeknumer 18 that was missing.

 

I recorded it as a gif:

 

Oqb9W11

 

I also get no delegation warning. What am I missing here? 😞

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @AlexJohn ,

Distinct() is a "hidden" delegation limitation, so you can do this

With(
   {
      wList:
      Filter(
         Wochenbericht;
         KWNummer <= varKWN
      )
   };
   SortByColumns(
      Distinct(
         wList;
         KWNummer
      );
      "Result";
      Descending
   )
)

providing the top filter returns record numbers under your Delegation limit.

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @AlexJohn ,

Distinct() is a "hidden" delegation limitation, so you can do this

With(
   {
      wList:
      Filter(
         Wochenbericht;
         KWNummer <= varKWN
      )
   };
   SortByColumns(
      Distinct(
         wList;
         KWNummer
      );
      "Result";
      Descending
   )
)

providing the top filter returns record numbers under your Delegation limit.

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

AlexJohn
New Member

@WarrenBelz Thank you, this looks very good!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (3,465)