Forum Discussion

gauravnarchal's avatar
gauravnarchal
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Count Weekends

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...
  • v-zhangti's avatar
    4 years ago

    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.