cancel
Showing results for
Did you mean:
Frequent Visitor

## Weekend Calculation- Select startdate & enddate - weekend calculate (Saturday & sunday count 1(one))

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.

Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### 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.

#### June User Group Leader Call

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

#### 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.

#### 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
Top Kudoed Authors
Users online (1,410)