Calculation Issues

Distribute Monthly Target Values Across Daily Accrual Records in Power BI

Ayan MasoodAyan Masood Nov 12, 2026 870 views

Question details

Allocate each monthly target across daily accrual records for the matching point ID and month.

Distribute Monthly Target Values Across Daily Accrual Records in Power BI
Product
Microsoft Power BI data model and DAX
Device & OS
not provided
Scenario
A report contains monthly target values, daily accrual records, and a calendar table that must be used to calculate a daily target allocation.
Observed behavior
The monthly target must be divided by the applicable number of days and aggregated correctly for each point ID and date.
Before you start

Confirm that the Calendar table includes every reporting date and is marked as a date table if required by your model. Also confirm whether targets should be spread across calendar days, business days, or only dates with recorded accruals.

Solution 1Recommended

Add a DaysInMonth column to the Calendar table

Use this method when monthly targets should be allocated evenly across every calendar day in the month.

A Calendar table provides a consistent date dimension for daily accrual records and monthly target calculations. The DaysInMonth value should return the total number of calendar days for the month containing each date.

1
Open the Calendar table

In Power BI Desktop, select the Calendar table in Data view or Model view, then choose Table tools > New column.

2
Create the DaysInMonth column

Enter the DAX formula: DaysInMonth = DAY(EOMONTH('Calendar'[Date], 0)). This returns 28 to 31 based on each row's month.

3
Add a month key

Choose Table tools > New column and create a common month key, such as MonthStart = DATE(YEAR('Calendar'[Date]), MONTH('Calendar'[Date]), 1), for matching monthly target rows.

4
Check the result

Sort the Calendar table by Date and verify that every date in the same month displays the same DaysInMonth value.

Add a DaysInMonth column to the Calendar table
Power Query option: You can also add the days-in-month value in Power Query by selecting Add Column and creating a custom column based on Date.DaysInMonth([Date]).
WPS Spreadsheet solution

Calculate Daily Allocations from Monthly Targets in WPS Spreadsheet

WPS Spreadsheet can distribute monthly target values across daily records with a calendar sheet, a days-in-month formula, and lookup formulas that match each point ID and month. This is useful when you need a transparent worksheet-based allocation instead of a DAX data model.

  1. 1. Create a calendar column: In WPS Spreadsheet, enter each reporting date in a Calendar sheet and add a MonthStart column with =DATE(YEAR(A2),MONTH(A2),1).
  2. 2. Calculate days in the month: In the next Calendar column, enter =DAY(EOMONTH(A2,0)) and fill the formula down for all calendar dates.
  3. 3. Add a matching month to accruals: In the Accruals sheet, add a MonthStart column using =DATE(YEAR([@Date]),MONTH([@Date]),1), or use equivalent cell references.
  4. 4. Retrieve the monthly target: Use SUMIFS to match the target by point ID and month, for example =SUMIFS(Targets!$C:$C,Targets!$A:$A,[@PointID],Targets!$B:$B,[@MonthStart]).
  5. 5. Calculate the daily target: Divide the retrieved monthly target by the DaysInMonth value returned from the Calendar sheet, then fill the formula down the daily accrual table.
Calculate the number of calendar days with the EOMONTH and DAY functions.Match monthly targets to daily records by point ID and month using XLOOKUP or SUMIFS.Review each daily allocation directly in a spreadsheet table.Open and save Microsoft Excel .xlsx files with compatible formulas and worksheet layouts.
microsoft office alternative - wps office

Frequently Asked Questions

How do I calculate the number of days in a month in DAX?

Create a calculated column in the Calendar table with DaysInMonth = DAY(EOMONTH('Calendar'[Date], 0)). The formula returns the last day number of the month, which is the total number of days.

Should a monthly target be divided by calendar days or recorded accrual days?

Use calendar days when the target applies continuously throughout the month. Use recorded accrual days only when the business rule allocates targets exclusively to dates that have qualifying records. Business-day allocation requires a Calendar table flag such as IsBusinessDay.

Why does my daily target not total to the monthly target?

Check that the visual includes all dates in the month, the target is matched to the correct point ID and month, and the DaysInMonth value comes from the same Calendar date context. Missing dates and incorrect relationship filters commonly cause differences.

Can I use Power Query instead of DAX to add DaysInMonth?

Yes. In Power Query, select Add Column > Custom Column and use Date.DaysInMonth([Date]). Load the resulting Calendar table back into the model and use that column in your allocation calculation.

How can I allocate targets only across business days?

Add an IsBusinessDay column to the Calendar table, mark weekdays and exclude holidays, then calculate the count of rows where IsBusinessDay is true for the current month. Divide the monthly target by that business-day count rather than by DaysInMonth.