I need weekend calculation based on selection of start date and enddate and saturday and sunday count one
ClearCollect(DateRange,AddColumns(FirstN([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],DateDiff(DataCardValue22.SelectedDate, DataCardValue21.SelectedDate, Days) + 1),"Day","Day" & (Value + 1),"Date",DateAdd(DataCardValue22.SelectedDate, Value, Days),"Weekend",If(Weekday(DateAdd(DataCardValue22.SelectedDate, Value, Days))=1 ||Weekday(DateAdd(DataCardValue22.SelectedDate, Value, Days))=7,1,0)));
UpdateContext({showWeekendCount:true})
currently i using above code but that is only calculated the till 9 weekend i want dynamic not fixed.
Hi @AmitSaraswat,
I have made a test on my side, if you want to calculate the weekend (Saturday&Sunday count 1 one) between the two different dates dynamically, I afraid that there is no way to achieve your needs in PowerApps currently.
If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas
In addition, I don't think the formula that you provided could calculate weekend (Saturday&Sunday count once) between two different dates. If the dates between the startdate and the enddate contains Saturday and Sunday, the formula that you provided would count weekend twice (One for Saturday, one for Sunday).
Best regards,
Kris
User | Count |
---|---|
259 | |
110 | |
97 | |
56 | |
39 |