Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I want to see the count of dates that lie in current week.
I am using the expression
=count({< [Date] = {">=$(=WeekStart(Today()))<=$(=WeekEnd(Today()))"}>}[Date])
but there is no output.
Any suggestions on what am I doing wrong ?
the Set is correct
in my opinion it is necessary to check the date format
=count({< [Date] = {">=$(=Date(WeekStart(Today()),'DATEFORMAT'))<=$(=WeekEnd(Today()))"}>}[Date])
DATEFORMAT is your date format
same for weekend
Hi @VS2
In my experience dates in set analysis are very confusing and I try and avoid it where I can! In this instance I'd add a new field in your data model called e.g. ThisWeek-
LOAD *
, IF [Date] >= DATE(WEEKSTART(TODAY())), 'Y', 'N') AS ThisWeek;
Then you can use that in your set analysis. COUNT({<ThisWeek={'Y'}>}[Date])
Not exactly what you were asking but hope it helps