Others

How to Calculate Month-to-Date (MTD) Sales Target in Power BI with DAX

Anum MushtaqAnum Mushtaq Oct 29, 2026 870 views

Question details

The user needs to create a DAX measure in Power BI to prorate a monthly sales target up to the current day and compare it against actual MTD sales.

Calculate a Month-to-Date Sales Target in Power BI with DAX
Product
Microsoft Power BI
Device & OS
not provided
Scenario
Tracking partial-month sales performance by comparing real-time revenue against a dynamically prorated daily expectation of the monthly goal.
Observed behavior
A DAX formula is needed to dynamically adjust the sales target based on the elapsed days in the current month within the applied filter context.
Before you start

Ensure you have a dedicated Date Table in your Power BI data model, marked correctly as a 'Date Table', with active relationships to your Sales and Targets fact tables.

Solution 1Recommended

Create a Prorated MTD Target DAX Measure

Build a DAX measure that calculates the number of elapsed days in the current month, divides it by the total days in that month, and multiplies the result by the total monthly target.

To accurately compare your actual sales with the target expected by the current day, you cannot simply use the total monthly target. Prorating the target using variables for the current day and total days in the month ensures a fair, apples-to-apples MTD comparison.

1
Open the New Measure Formula Bar

In Power BI Desktop, navigate to the 'Modeling' tab on the ribbon and click on 'New Measure' to open the DAX formula bar.

2
Define Total Days and Elapsed Days Variables

Begin your DAX formula by defining variables. Use `DAY(EOMONTH(MAX('Date'[Date]), 0))` to find the total days in the current month, and `DAY(MAX('Date'[Date]))` to get the elapsed days.

3
Retrieve the Monthly Target

Define another variable to pull the monthly target within the current filter context, for example: `VAR CurrentTarget = CALCULATE(SUM('Targets'[MonthlyTarget]))`.

4
Calculate the Final Prorated Amount

Use the `RETURN` statement to output the prorated target by dividing the elapsed days by the total days, then multiplying by the target variable: `RETURN DIVIDE(ElapsedDays, TotalDays) * CurrentTarget`.

5
Apply Context via Visualizations

Add your newly created measure to a Gauge, KPI, or Bar chart visual. Make sure the visual uses the Date hierarchy from your marked Date table to apply the MTD filter context correctly.

Create a Prorated MTD Target DAX Measure
Handling Context Over Dates: If you are viewing data at the month or year level rather than the daily level, you may need to wrap your actual sales measure in the `TOTALMTD()` or `CALCULATE(..., DATESMTD())` function to align properly with the prorated target.
Free Microsoft Office alternative

Simplify Your Data Analysis with WPS Spreadsheet

While Microsoft Power BI is excellent for advanced DAX modeling, many daily data analysis tasks and MTD calculations can be efficiently handled in a spreadsheet environment. WPS Office offers a free, highly capable suite with a familiar interface, allowing you to build robust dashboards and track targets seamlessly without heavy software requirements.

  1. 1. Download and Install: Download WPS Office for free from the official website and follow the brief installation wizard.
  2. 2. Open Your Data File: Launch WPS Spreadsheet and securely open your existing Microsoft Excel or CSV data exports.
  3. 3. Track Targets with Formulas: Utilize built-in functions like EOMONTH, SUMIFS, and PivotTables to seamlessly track your prorated sales goals.
Seamlessly compatible with Microsoft Excel (.xlsx) and CSV formats.Handle MTD and YTD calculations easily using built-in spreadsheet date functions.Familiar user interface ensuring zero learning curve for Excel users.Lightweight software that runs smoothly on standard hardware devices.Completely free to download, including powerful Presentation and PDF editing tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my DAX MTD calculation showing blank or incorrect values?

This typically occurs if your Date table does not have an active relationship with your Fact table, or if there are missing/non-contiguous dates. Ensure your Date table is properly flagged as a 'Date Table' in the Model view.

Can I calculate a Year-to-Date (YTD) target using a similar method?

Yes. You can adapt the DAX logic by calculating the elapsed days in the current year and dividing by the total days in the year (365 or 366). Alternatively, use the built-in `TOTALYTD` function on your target measure.

How do I account for weekends and holidays in my prorated target?

To skip weekends and holidays, you need to add an 'IsWorkingDay' boolean column to your Date table. You can then use `CALCULATE` and `COUNTROWS` to count only the elapsed working days and divide by the total working days in that month, rather than standard calendar days.