Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I want to count the weekend (Fri & Sat) as of today. How can I add "as of today" to the below measure so I can get the desired result count 1?
_weekendcountasoftoday =
CALCULATE(
COUNTROWS('Calendar'), all('Calendar'), 'Calendar'[WeekdayWeekend] = "Weekend")
Calendar Table
| MonthYear | WeekdayNumber | Date | WeekdayWeekend | Weekday |
| Apr-22 | 5 | 01-04-22 0:00 | Weekday | Fri |
| Apr-22 | 6 | 02-04-22 0:00 | Weekend | Sat |
| Apr-22 | 0 | 03-04-22 0:00 | Weekend | Sun |
| Apr-22 | 1 | 04-04-22 0:00 | Weekday | Mon |
| Apr-22 | 2 | 05-04-22 0:00 | Weekday | Tue |
| Apr-22 | 3 | 06-04-22 0:00 | Weekday | Wed |
| Apr-22 | 4 | 07-04-22 0:00 | Weekday | Thu |
| Apr-22 | 5 | 08-04-22 0:00 | Weekday | Fri |
| Apr-22 | 6 | 09-04-22 0:00 | Weekend | Sat |
| Apr-22 | 0 | 10-04-22 0:00 | Weekend | Sun |
| Apr-22 | 1 | 11-04-22 0:00 | Weekday | Mon |
| Apr-22 | 2 | 12-04-22 0:00 | Weekday | Tue |
| Apr-22 | 3 | 13-04-22 0:00 | Weekday | Wed |
| Apr-22 | 4 | 14-04-22 0:00 | Weekday | Thu |
| Apr-22 | 5 | 15-04-22 0:00 | Weekday | Fri |
| Apr-22 | 6 | 16-04-22 0:00 | Weekend | Sat |
| Apr-22 | 0 | 17-04-22 0:00 | Weekend | Sun |
| Apr-22 | 1 | 18-04-22 0:00 | Weekday | Mon |
| Apr-22 | 2 | 19-04-22 0:00 | Weekday | Tue |
| Apr-22 | 3 | 20-04-22 0:00 | Weekday | Wed |
| Apr-22 | 4 | 21-04-22 0:00 | Weekday | Thu |
| Apr-22 | 5 | 22-04-22 0:00 | Weekday | Fri |
| Apr-22 | 6 | 23-04-22 0:00 | Weekend | Sat |
| Apr-22 | 0 | 24-04-22 0:00 | Weekend | Sun |
| Apr-22 | 1 | 25-04-22 0:00 | Weekday | Mon |
| Apr-22 | 2 | 26-04-22 0:00 | Weekday | Tue |
| Apr-22 | 3 | 27-04-22 0:00 | Weekday | Wed |
| Apr-22 | 4 | 28-04-22 0:00 | Weekday | Thu |
| Apr-22 | 5 | 29-04-22 0:00 | Weekday | Fri |
| Apr-22 | 6 | 30-04-22 0:00 | Weekend | Sat |
Solved! Go to Solution.
Hi, @gauravnarchal
You can try the following methods.
_weekendcountasoftoday =
CALCULATE (
COUNTROWS ( 'Calendar' ),
FILTER (
ALL ( 'Calendar' ),
[WeekdayWeekend] = "Weekend"
&& [Date] <= TODAY ()
&& [Monthyear] = SELECTEDVALUE ( 'Calendar'[Monthyear] )
)
)
The day I replied to you is April 5, and the weekend count should be 2.
When I replace today with April 2nd as you asked, I get the result you were expecting before with the number 1.
This should be your desired outcome.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @gauravnarchal
You can try the following methods.
_weekendcountasoftoday =
CALCULATE (
COUNTROWS ( 'Calendar' ),
FILTER (
ALL ( 'Calendar' ),
[WeekdayWeekend] = "Weekend"
&& [Date] <= TODAY ()
&& [Monthyear] = SELECTEDVALUE ( 'Calendar'[Monthyear] )
)
)
The day I replied to you is April 5, and the weekend count should be 2.
When I replace today with April 2nd as you asked, I get the result you were expecting before with the number 1.
This should be your desired outcome.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
maybe try
CALCULATE(
COUNTROWS('Calendar'), all('Calendar'), 'Calendar'[WeekdayWeekend] = "Weekend" && ‘Calendar'[Date]<=today() )
Proud to be a Super User!
Hi @ryan_mayu - I am not getting the result using this measure. When I select the month April’22 in the slicer, I am getting the result as 861 which is YTD instead of 1 as this month (April 22) today is the first weekend.
Hi,
This measure works
=CALCULATE(COUNTROWS('Calendar'),'Calendar'[WeekdayWeekend]="Weekend",DATESBETWEEN('Calendar'[Date],MINX(all('Calendar'),'Calendar'[Date]),today()))
Thanks @Ashish_Mathur - It gives me the count of the weekend results as YTD. How can I get the result weekend result for MTD as of today?
Hi,
What do you mean by MTD as of today and how can the answer be 26?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.