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
Hi,
I have a time dimension with workday flag for each day also considering national holidays as shown in below snippet:
I am trying to create a measure which could sum up WORK_DAY_FLAG for each month, so that i can show it in tooltip of a bar chart having month name in x-axis.
The issue I am facing is it is summing up the entire year workdays and returning that value for all months, if i apply month level filter in measure that returns value specific to that month for all other months too.
The DAX I am using is below:
CY Workdays by Month = CALCULATE(SUM(WORK_DAY_FLAG),YEAR(DATE_DT) = YEAR(TODAY()))
PY Workdays by Month = CALCULATE(SUM(WORK_DAY_FLAG),YEAR(DATE_DT) = YEAR(TODAY())-1)
While Applying Month filter too:
CY Workdays by Month = CALCULATE(SUM(WORK_DAY_FLAG),YEAR(DATE_DT) = YEAR(TODAY()),MONTH(DATE_DT) <= MONTH(TODAY()))
PY Workdays by Month = CALCULATE(SUM(WORK_DAY_FLAG),YEAR(DATE_DT) = YEAR(TODAY())-1,MONTH(DATE_DT) = MONTH(TODAY()))
Any ideas would be appreciated to show Current and prior year, monthly sum of workdays.
Not clear what your expected outcome is. Read about SAMEPERIODLASTYEAR.
@lbendlin @AntrikshSharma @giorgikok @Hettic @rafaesanto83
Please Help !! Let me know if you need any clarity on the same.
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.