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
mb0307
Responsive Resident
Responsive Resident

Weekly data into monthly format

Hi all,

 

I want to summarise Weekly data into Month format.

 

I do not have Day/Date level information in the table.  Data only comes in Weekly format so having a calendar table might not solve the issue. 

 

JULY 2020 Calendar:

WEEKMonTueWedThuFriSatSun
27293012345
286789101112
2913141516171819
3020212223242526
31272829303112

 

Week 27 and 31 spread into two months.

 

I want to sum [SALES] numbers for July but ignoring Non-July days (in gray).  I want to apply this to all the months in any given year.

 

Eg data:

NOTEWeekSales
Source data has no date field27100
Source data has no date field27200
Source data has no date field27200
Source data has no date field301000
Source data has no date field301000
Source data has no date field3150
Source data has no date field3150
Source data has no date field31100

 

 

Output:

WeekWeekSales SumSales Sum * (5/7 days of week)Result 
27500357.1Week 27 has 5 days in July and 2 in June so Sales sum for JULY should only incl 5 days.  I guess in absence of DATE field in the source data, the percentage of 5days (5/7 days of a week) can be used to multiple by Sales to complete montly sum
3020002000Entire week is in July
31200142.95 days in July and 2 in Aug so Sales sum for JULY should only incl 5 days

 

Please let me know if this can be achieved using DAX.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Hi, @mb0307 

You may check if the sample file helps.

pbix. attached

If it meets your requirement,please follow these step:

1.create calcualted column in original table:

 

Sum sales this week = CALCULATE(SUM('Original Table'[Sales]),ALLEXCEPT('Original Table','Original Table'[Year],'Original Table'[Week]))
Average daily sales this week = 'Original Table'[Sum sales this week]/7

 

2.Then create a new table with calendar date

 

New table with Calendar = CALENDAR(DATE(2019,01,01),DATE(2020,12,30))

 

Add new calculated  columns:

 

WeekNum = WEEKNUM('New table with Calendar'[Date],2)
average daily sales = 
var a =CALCULATE(MAX('Original Table'[Average daily sales this week]),FILTER('Original Table','Original Table'[Week]='New table with Calendar'[WeekNum]))
return IF(ISBLANK(a),0,a)

 

Apply the filelds to  table visualization  and the result will show as below:

42.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@mb0307 , from week you can get week start date like this

 

date = date([year],[Week No]*7 -Weekday(date([year],1,1)))

 

This was with format YYYY WW

Weektodate = date(RIGHT(Table[Week Format],4),1,1)+(mid(Table[Week Format],5,SEARCH(" ",Table[Week Format])-5 )*7) - (WEEKDAY(date(RIGHT(Table[Week Format],4),1,1)))

 

once you have a date you can manage with date dimension. Across month you need split 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
AllisonKennedy
Super User
Super User

Not sure I understand the full problem - what does the data look like in raw form? You have put a calendar in your post, does the data come in calendar format with Sales instead of the date? 

 

You will likely still need a DimDate table: https://allisonkennedycv.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

I would likely do the transformation of the data in Power Query Editor and not jsut DAX, but need to know a few more details.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy  Please see my original pot.  I have added more info.  Thank you.

 

@amitchandak  I will try your method.  But first formula throwing this error: Too few arguments were passed to the DATE function. The minimum argument count for the function is 3.

Hi, @mb0307 

You may check if the sample file helps.

pbix. attached

If it meets your requirement,please follow these step:

1.create calcualted column in original table:

 

Sum sales this week = CALCULATE(SUM('Original Table'[Sales]),ALLEXCEPT('Original Table','Original Table'[Year],'Original Table'[Week]))
Average daily sales this week = 'Original Table'[Sum sales this week]/7

 

2.Then create a new table with calendar date

 

New table with Calendar = CALENDAR(DATE(2019,01,01),DATE(2020,12,30))

 

Add new calculated  columns:

 

WeekNum = WEEKNUM('New table with Calendar'[Date],2)
average daily sales = 
var a =CALCULATE(MAX('Original Table'[Average daily sales this week]),FILTER('Original Table','Original Table'[Week]='New table with Calendar'[WeekNum]))
return IF(ISBLANK(a),0,a)

 

Apply the filelds to  table visualization  and the result will show as below:

42.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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