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 / Help with delegation f...
Power Apps
Answered

Help with delegation filtering for Date Range

(0) ShareShare
ReportReport
Posted on by 242
Hello,
 
i have a Gallery with code below in its item's Property..
Displaying the days of actual month + Teams (Anzeigetext) and collecting Projects assigned to specific day and team (Dataverse Table), either Start_Date on the day, or longer project and its Project duration on it..
 
AddColumns(
    Sequence(
        Day(
            DateAdd(
                DateAdd(
                    Date(
                        Year(var_date);
                        Month(var_date);
                        1
                    );
                    1;
                    TimeUnit.Months
                );
                -1;
                TimeUnit.Days
            )
        );
        0;
        1
    );
    Datum;
    var_date + Value;
    Gewerk;
    ThisItem.Leistungsfeld;
    Ausführende;
    ThisItem.Anzeigetext;
    ID;
    Concatenate(
        ThisItem.Anzeigetext;
        "-";
        var_date + Value
    );
    Projekte;
    Filter(
        Sort(
            Filter(
                Partie_Einteilung_Database;
                Partie = ThisItem.Anzeigetext;
                !IsBlank(Umsetzungsdauer)
            );
            Start_Date;
            SortOrder.Descending
        );
        Start_Date <= DateAdd(
            var_date;
            Value
        ) && calc_end_Date > DateAdd(
            var_date;
            Value
        )
    );
    Anmerkung;
    Filter(
        Sort(
            Filter(
                Partie_Einteilung_Database;
                Partie = ThisItem.Anzeigetext;
                !IsBlank(new_anmerkungen)
            );
            Start_Date;
            SortOrder.Descending
        );
        Start_Date = DateAdd(
            var_date;
            Value
        )
    )
)
 
the DateAdd in the filter for "Projekte" is not delegable are there other ways how i could solve this?
I had other versions of this code:
 
Start_Date <= (var_date + Value&&
(Start_Date + Umsetzungsdauer) [instead of calc_end_Date] > (var_date + Value)
 
in this case only (Start_Date + Umsetzungsdauer) was marked to have delegation problems,
so i decided to exchange it with a Dataverse column and do the calculation there, so the new formular looked like that:
 
Start_Date <= (var_date + Value&&
calc_end_Date > (var_date + Value)
 
using this formular i then got a runtime error on labels in the gallery, but not in the code it self:
 
A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.Int32' for operator kind 'Add'.
 
 
Is there a way to solve this - getting it non delegable and not getting any error 
 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    I have tried to make this Delegable - note free-typed, so watch brackets, separators etc
    AddColumns(
       AddColumns(
          Sequence(
             Day(
                DateAdd(
                   DateAdd(
                      Date(
                         Year(var_date);
                         Month(var_date);
                         1
                      );
                      1;
                      TimeUnit.Months
                   );
                   -1;
                   TimeUnit.Days
                )
             );
             0;
             1
          );
          _Date;
          DateAdd(
            var_date;
            Value
          );
          _Partie;
          Sort(
             Filter(
                Partie_Einteilung_Database;
                Partie = ThisItem.Anzeigetext
             );
             Start_Date;
             SortOrder.Descending
          )
       );
       Datum;
       _Date;
       Gewerk;
       ThisItem.Leistungsfeld;
       Ausführende;
       ThisItem.Anzeigetext;
       ID;
       ThisItem.Anzeigetext & "-" & _Date;
       Projekte;
       Filter(
          _Partie;
          Start_Date <= _Date;
          calc_end_Date > _Date;
          !IsBlank(Umsetzungsdauer)
       );
       Anmerkung;
       Filter(
          _Partie;
          Start_Date <= _Date;
          !IsBlank(new_anmerkungen)
       )
    )

    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    LinkedIn    Buy me a coffee

  • TSte Profile Picture
    242 on at
    hi, and thank you very much for that fast response!
     
    unfortunately its arguing about Value
    it says name invalid, Value not recognized..
     
  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    I have had another attempt at the structure - as noted before, this is really to give you an idea of a possible way to manage the Delegation issue - I cannot see your data, so some elements may not be correct.
     
    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    LinkedIn   
  • TSte Profile Picture
    242 on at
    Thanks!
    Did need a little adaption, but basically that way the delegation problems where solved!
     
    best regrads
    Thomas

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard