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
poweringthru
Helper I
Helper I

Calculate Sum on a Weekday basis fails on a Monthly and Yearly display

I'm using 2 Tables for this, Calendar and Plan.

 

Calendar has the usual:

DateYearMonthNumMonthWeekdayDayWeekDayOfYear
Sunday, January 1, 202320231jan6111
Monday, January 2, 202320231jan0222
Tuesday, January 3, 202320231jan1323
...       

 

Calendar = calendar(date(2023,1,1),date(2024,12,31))
Year = YEAR('Calendar'[Date])
MonthNum = MONTH('Calendar'[Date])
Month = FORMAT('Calendar'[Date],"mmm")
Weekday 
= WEEKDAY(Calendar[Date],3) /* option 3 gives 0 = Monday, 1 = Tuesday, ...
Day = DAY(Calendar[Date])
Week = WEEKNUM('Calendar'[Date],2)
DayOfYear = FORMAT([Date], "Y")

Plan assigns an Amount for an Id on a given Weekday:
IdAmountWeekday
110
111
112
113
114
115
116
230
231
232
233
234
235
236
380
382
384
460
462
464
5115
5116
691
693

 

The relationship I'm using between tables for now is Weekday - Weekday (a many to many, as you can imagine).

The measure for now is:
TotalAmount = CALCULATE(SUM(Plan[Amount]))

So, the thing is, if I display a Matrix for TotalAmount by Id against Date works fine on a daily or weekly basis but fails for month and year totals, it looks as following:

poweringthru_0-1683042483555.png

How would you go about getting it right also on a monthly and yearly basis?

Do I need to adjust TotalAmount measure?

2 REPLIES 2
amitchandak
Super User
Super User

@poweringthru , Does your second table has a date ? why do you need populate weekday to ID?

 

can you make sure your date to join(calendar date and fact date) is correct? Because if the data is correct at the date of the calendar, it should rollup correctly

 


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey, thank you for answering!

 

Plan table is Weekday driven, rows don't have a specific date. I need it to apply to any given month and year.

 

Here is a test pbix document in a WeTransfer link:

https://we.tl/t-2kioURKTvH

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.

Top Solution Authors