I have found a few posts in this community that explain comparing date fields from SharePoint to PowerApps dates but nothing that could explain why the following formula is not getting the correct count based upon my filter in a SharePoint list view:
Set(
varCountRowsClosed,
CountRows(
Filter(
RFS,
HiringJobStatus.Value = "Closed" || HiringJobStatus.Value = "Closed - No Bid" || HiringJobStatus.Value = "Closed - Lost Bid" && Year(Text("Request_x0020_Date",ShortDate)) = Year(Text(Now(),ShortDate))
)
)
);
Set(
varAvgDaysUntilClosed,
Sum(
RFS,
DaysUntilClosed
)/varCountRowsClosed
)
Request_x0020_Date is a date/time column in SharePoint online list and Now is in PowerApps. The HiringJobStatus column is a choice field which shouldn't be what mis calculating. In the second variable set, varAvgDaysUntilClosed, the DaysUntilClosed column is a calculated column. But the first variable I am setting, varCountRowsClosed, with the Count Rows fx is calculating 441 rows when there should only be 21 according to the count in my view. I have made so many changes and cannot get it to jive. Any help is much appreciated.