@CarlosFigueira
I have seen the other posts that seemed to fix this problem, and I incorporated your solution from this post, but now I've realized a problem.
If you can recall, I have an app where the user selects an "Exit Date". This exit date calculates three additional dates, that must not occur on a weekend or holiday. I've created a holiday table in onedrive.
The Exit Date determines the 3 month, 6 month, and 12 month days. All of which, as expressed above, can't occur on a weekend or holiday.
I'm currently using the below formula which you graciously supplied, specifically this is for the three month date:
If( Weekday(DateAdd(DataCardValueExitDate.SelectedDate, 90, Days), StartOfWeek.Saturday) > 2, DateAdd(DataCardValueExitDate.SelectedDate, 90, Days), DateAdd( DataCardValueExitDate.SelectedDate, 90 + 3 - Weekday(DateAdd(DataCardValueExitDate.SelectedDate, 90, Days), StartOfWeek.Saturday), Days)) + CountIf(Holidays, Date >= DataCardValueExitDate, Date <= DataCardValue3MonthDate).
The problem is, this logic can still produce a value on a weekend. For example if the Exit Date is November 28, and accounting for 3 holidays (Dec 25, Dec 26, Jan 1), it returns a 3 month date value of Saturday, March 2, 2019.
I think I need a way for PowerApps to distinguish if in fact the 3 month date lands on the stat holiday but I'm unsure as to how to write the logic. Basically I need:
(If 3month=stat holiday, then bump to a non stat, and weekday)
Any thoughts?