Forum Discussion
tanct
8 years agoRegular Visitor
Cumulative Weekday
Dear All, Could you please share what is the Dax code for the cumulative working day for the following condition below:- 1. First working day of the month assigned as 1, then cumulative ad...
- 8 years ago
Hi tanct,
Try this calculated column formula
=CALCULATE(COUNTROWS('DIM-Calendar'),FILTER('DIM-Calendar','DIM-Calendar'[Date]<=EARLIER('DIM-Calendar'[Date])&&'DIM-Calendar'[Date]>=EARLIER([Date])-DAY(EARLIER([Date]))+1&&'DIM-Calendar'[Weekend]=1))Hope this helps.
- 8 years ago
You can also try to create a calculated column with following formula.
Cumulative Weekday = CALCULATE ( SUM ( 'DIM-Calendar'[Weekend] ), FILTER ( 'DIM-Calendar', 'DIM-Calendar'[Date] <= EARLIER ( 'DIM-Calendar'[Date] ) && 'DIM-Calendar'[Year] = EARLIER ( 'DIM-Calendar'[Year] ) && 'DIM-Calendar'[Month] = EARLIER ( 'DIM-Calendar'[Month] ) ) )Best Regards,
Herbert
v-haibl-msft
8 years agoMicrosoft Employee
You can also try to create a calculated column with following formula.
Cumulative Weekday =
CALCULATE (
SUM ( 'DIM-Calendar'[Weekend] ),
FILTER (
'DIM-Calendar',
'DIM-Calendar'[Date] <= EARLIER ( 'DIM-Calendar'[Date] )
&& 'DIM-Calendar'[Year] = EARLIER ( 'DIM-Calendar'[Year] )
&& 'DIM-Calendar'[Month] = EARLIER ( 'DIM-Calendar'[Month] )
)
)
Best Regards,
Herbert