I am trying to display the count of items that were created last month lets say now August 2022.
here is my code
With(
{
StartDate: Date(
Year(Today()),
Month(Today()) - 1,
1
),
EndDate: Date(
Year(Today()),
Month(Today()),
1
) - 1
},
ClearCollect(
collcreatedlastmonth,
Filter(
'mylist',
Created >= StartDate,
Created <= EndDate
)
)
);
I do have items created in August but it displays 0 . what is wrong with the formulae
Please consider changing your Formula to the following:
With(
{StartDate: Date(Year(Today()), Month(Today()) - 1, 1),
EndDate: DateAdd(Date(Year(Today()), Month(Today()) + 1, 1), -1, Days)
},
ClearCollect(collcreatedlastmonth,
Filter('mylist',
Created >= StartDate,
Created <= EndDate
)
)
);
This would include the prior month and any records in the current month.
I hope this is helpful for you.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 2