Monthly to weekly budget
Finance teams often prepare budgets by month, but the actual sales arrive by week, so the budget has to be restated at the same weekly grain before the two can be compared.
The usual manual fix is to divide each month’s budget by 4 for a four-week month, or by 5 for a five-week month. This page does the same thing in Power Query, so the weekly budget rebuilds itself whenever the budget or the calendar changes.
The approach has six parts:
- Use a weekly 5-4-4 calendar as a mapping table. It maps each week to its month, so it shows which months have four weeks and which have five. Two extra columns, YYMM for the month and YYWW for the week, give the keys for the joins that follow.
- Load the Monthly Budget into Power Query as a connection only.
- Build a Week Count query from the calendar, which gives the number of weeks in each month.
- Merge the Week Count query into the Monthly Budget query, so each month’s budget sits beside its number of weeks.
- Merge the weekly calendar into that extended budget query. Because each month matches four or five weeks, the merge repeats each month’s budget line once per week, which gives a table with one row per week. Each row still carries the whole month’s budget, though.
- Divide each row’s monthly budget by the number of weeks in its month, which gives the Weekly Budget.
1. Start from a weekly 5-4-4 calendar
Section titled “1. Start from a weekly 5-4-4 calendar”- Start with a weekly 5-4-4 calendar table, such as the one built on the 554 calendar page.
Add two custom columns to it, YYWW and YYMM, with the M code below.
YYWW:
= Number.FromText( Text.End( Number.ToText( Date.Year([Week Ending])), 2)) * 100 + [Fin Week]YYMM:
= Number.FromText( Text.End( Number.ToText( Date.Year([Week Ending])), 2)) * 100 + [Fin Month]Each formula takes the last two digits of the year, multiplies them by 100 and adds the week or month number, so week 3 of 2020 becomes 2003 and month 1 becomes 2001.
Loaded into Excel with the two new columns, the calendar looks like this:

2. Load the monthly budget
Section titled “2. Load the monthly budget”- Load the monthly budget table into Power Query.
- Choose Close & Load To and load the query as Only Create Connection.
The budget has one row per month, keyed by YYMM:

3. Create a Week Count query
Section titled “3. Create a Week Count query”The next query counts the weeks in each month.
- In the Queries & Connections pane, right-click the weekly calendar query and choose Reference.

- In the new query, click Group By, group on YYMM, and add a column called Count with the operation Count Rows.

The query now returns the number of weeks in each month:

- Name the query Week Count.
- Close & Load it as Only Create Connection.
4. Merge the week count into the monthly budget
Section titled “4. Merge the week count into the monthly budget”The budget query needs each month’s week count beside its budget.
- Open the Monthly Budget query in the Power Query Editor.
- On the Home tab, click Merge Queries.
- In the Merge dialog, choose the Week Count table, match the two tables on YYMM, and keep the join kind as Left Outer.

- Expand the new column, ticking only Count:

Each month’s budget now has its week count beside it:

5. Merge the weekly calendar into the budget
Section titled “5. Merge the weekly calendar into the budget”Carry on editing the same query, and click Merge Queries again. Choose the weekly calendar, make another Left Outer join, and match the YYMM columns of the two tables.


6. Add a Weekly Budget column
Section titled “6. Add a Weekly Budget column”Each row now stands for one week, but its Budget is still the month’s total. Add a custom column called Weekly Budget that divides the Budget by the Count of weeks.
![The Custom Column dialog creating Weekly Budget as [Budget] / [Count]](/_astro/monthly-weekly-budget-11.MinRWagw_1GE154.webp)
- Finally, Close & Load this query to Excel as a Table, rather than as a connection only.
The weekly budget then loads into Excel like this:

7. Review the query dependencies
Section titled “7. Review the query dependencies”In the Power Query Editor, the Query Dependencies button on the View tab shows how the queries connect:
