Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
apple43
Frequent Visitor

Forecasting current month based on previous month - measure

Hi Community,

I want to create a report/table that shows the following information:

. Country
. qty sales (month to date) - measure already exists
. qty sales last month (total month) - measure already exists

. qty sales CM Total (forecast current month based on previous month) - need to create

. variance qty sales (month to date) - need to create

 

Example below:  Date = 14 Nov

 MTDOctober (total)Forecast November (total)var CM/LM (MTD)
United States8001500171418%
France2204504718%
Germany 200500429-11%
Spain175400375-3%

 

Can you help me?

Thank you!

2 ACCEPTED SOLUTIONS
v-xianjtan-msft
Community Support
Community Support

Hi @apple43 

 

You can create measures with the following DAX:

[MTD] and [October(total)] are measures you've already created.

Forecast November (total) = 
VAR DaysInCurrentMonth = DAY(EOMONTH(TODAY(), 0))
VAR DaysElapsed = DAY(TODAY())
VAR SalesPerDay = [MTD] / DaysElapsed
RETURN
SalesPerDay * DaysInCurrentMonth
CM/LM (MTD) = 
VAR DaysInLastMonth = DAY(EOMONTH(TODAY(), -1))
VAR DaysElapsed = DAY(TODAY())
VAR LM_MTD = [October (total)] * DaysElapsed / DaysInLastMonth
RETURN
[MTD] / LM_MTD - 1

 

vxianjtanmsft_0-1731636218981.png

(Since the TODAY() is used in Measure, the result are dynamic and the current screenshot result in 11/15.)

 

Best Regards,
Jarvis Tang
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

Poojara_D12
Super User
Super User

Hi @apple43 

To create a report or table like this, you’ll need to add some calculations in your dataset or BI tool. Here’s how to approach creating each measure based on your example. I’ll walk you through the formulas for:

  1. Qty Sales CM Total (Forecast Current Month): Using October as a basis, this forecast assumes that the rest of the month will perform similarly to October.
  2. Variance Qty Sales (MTD): This measures the Month-to-Date (MTD) percentage difference compared to the Last Month’s MTD.

1. Qty Sales CM Total (Forecast for Current Month)

To create this forecast, you want to estimate the total sales for November based on the sales of October. A simple way to forecast is:

For example, if the current date is November 14th:

  • Days Elapsed: 14
  • Total Days in Month: 30

In DAX (for Power BI), you could write this formula as follows:

 

Forecast CM Total = 
    DIVIDE([MTD Sales], DAY(TODAY())) * DAY(EOMONTH(TODAY(), 0))

 

This formula takes the current Month-to-Date (MTD) sales, divides by the current day in the month to get an average per day, then multiplies by the total days in November (using EOMONTH).

 

2. Variance Qty Sales (MTD)

The MTD variance compares the current MTD sales against the previous month’s MTD sales to show percentage growth or decline.

In DAX, assuming you already have an MTD measure for last month, this would look like:

 

Variance Qty Sales (MTD) = 
    DIVIDE([MTD Sales] - [MTD Sales Last Month], [MTD Sales Last Month], 0) * 100

 

Here’s a breakdown of what each column would contain based on your description:

Country Qty Sales MTD (November) Qty Sales Last Month (October Total) Forecast CM Total (November) Var CM/LM (MTD)

United States8001500171418%
France2204504718%
Germany200500429-11%
Spain175400375-3%

Each of these columns would use the formulas provided to dynamically update as MTD sales and date changes. You can then use these measures in your table visual for a dynamic view of current sales trends and forecasted totals for the month.

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
YouTube: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

View solution in original post

4 REPLIES 4
Poojara_D12
Super User
Super User

Hi @apple43 

To create a report or table like this, you’ll need to add some calculations in your dataset or BI tool. Here’s how to approach creating each measure based on your example. I’ll walk you through the formulas for:

  1. Qty Sales CM Total (Forecast Current Month): Using October as a basis, this forecast assumes that the rest of the month will perform similarly to October.
  2. Variance Qty Sales (MTD): This measures the Month-to-Date (MTD) percentage difference compared to the Last Month’s MTD.

1. Qty Sales CM Total (Forecast for Current Month)

To create this forecast, you want to estimate the total sales for November based on the sales of October. A simple way to forecast is:

For example, if the current date is November 14th:

  • Days Elapsed: 14
  • Total Days in Month: 30

In DAX (for Power BI), you could write this formula as follows:

 

Forecast CM Total = 
    DIVIDE([MTD Sales], DAY(TODAY())) * DAY(EOMONTH(TODAY(), 0))

 

This formula takes the current Month-to-Date (MTD) sales, divides by the current day in the month to get an average per day, then multiplies by the total days in November (using EOMONTH).

 

2. Variance Qty Sales (MTD)

The MTD variance compares the current MTD sales against the previous month’s MTD sales to show percentage growth or decline.

In DAX, assuming you already have an MTD measure for last month, this would look like:

 

Variance Qty Sales (MTD) = 
    DIVIDE([MTD Sales] - [MTD Sales Last Month], [MTD Sales Last Month], 0) * 100

 

Here’s a breakdown of what each column would contain based on your description:

Country Qty Sales MTD (November) Qty Sales Last Month (October Total) Forecast CM Total (November) Var CM/LM (MTD)

United States8001500171418%
France2204504718%
Germany200500429-11%
Spain175400375-3%

Each of these columns would use the formulas provided to dynamically update as MTD sales and date changes. You can then use these measures in your table visual for a dynamic view of current sales trends and forecasted totals for the month.

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
YouTube: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Thank you for your help!

Simple approach.

v-xianjtan-msft
Community Support
Community Support

Hi @apple43 

 

You can create measures with the following DAX:

[MTD] and [October(total)] are measures you've already created.

Forecast November (total) = 
VAR DaysInCurrentMonth = DAY(EOMONTH(TODAY(), 0))
VAR DaysElapsed = DAY(TODAY())
VAR SalesPerDay = [MTD] / DaysElapsed
RETURN
SalesPerDay * DaysInCurrentMonth
CM/LM (MTD) = 
VAR DaysInLastMonth = DAY(EOMONTH(TODAY(), -1))
VAR DaysElapsed = DAY(TODAY())
VAR LM_MTD = [October (total)] * DaysElapsed / DaysInLastMonth
RETURN
[MTD] / LM_MTD - 1

 

vxianjtanmsft_0-1731636218981.png

(Since the TODAY() is used in Measure, the result are dynamic and the current screenshot result in 11/15.)

 

Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you for your help. 

Also solution for my problem. 

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors