Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
HI,
need to get count of working weekdays till now in a year using dax
help is appreciated.
Regards,
Raju
Solved! Go to Solution.
Hi @Anonymous ,
You may create calendar table, calculated column and measure like DAX below.
Table: Calendar=CALENDAR((YEAR(TODAY()),1,1), TODAY())
Column: If Weekday= IF(NOT WEEKDAY(calendar[Date]) IN {1,7}, 1, BLANK())
Measure: Total workdays = CALCULATE(COUNT(Calendar[Date]),FILTER(Calendar, Calendar[If Weekday]=1))
You can refer to the similar case: https://community.powerbi.com/t5/Desktop/DATEDIFF-Working-Days/td-p/130662 .
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You may create calendar table, calculated column and measure like DAX below.
Table: Calendar=CALENDAR((YEAR(TODAY()),1,1), TODAY())
Column: If Weekday= IF(NOT WEEKDAY(calendar[Date]) IN {1,7}, 1, BLANK())
Measure: Total workdays = CALCULATE(COUNT(Calendar[Date]),FILTER(Calendar, Calendar[If Weekday]=1))
You can refer to the similar case: https://community.powerbi.com/t5/Desktop/DATEDIFF-Working-Days/td-p/130662 .
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You would need to have a 'Date'[IsWorkingDay] column in your calendar table.
'Date'[IsWorkingDay] = NOT WEEKDAY( 'Date'[Date] ) IN { 1,7 }
Find out how to do all this here:
https://www.sqlbi.com/articles/counting-working-days-in-dax/
Good Luck! 🙂
User | Count |
---|---|
101 | |
68 | |
58 | |
47 | |
46 |