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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,114)