Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
lovebinds
Frequent Visitor

Aggregate Data available at day level to show sum for each month

Hi,

I have a time dimension with workday flag for each day also considering national holidays as shown in below snippet:

lovebinds_0-1683620722004.png

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.

 

2 REPLIES 2
lbendlin
Super User
Super User

Not clear what your expected outcome is. Read about SAMEPERIODLASTYEAR.

lovebinds
Frequent Visitor

@lbendlin @AntrikshSharma @giorgikok @Hettic @rafaesanto83 
Please Help !! Let me know if you need any clarity on the same.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.