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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
andrewb95
Helper II
Helper II

Forecasting based on current month (With Total Sales)

I want to make a prediction based on the current month total sales (I have a measure [TotalSalesMonth]). 

 

Example if it is the 5th of the month and there have been 50 sales to date then I would assume there are 10 sales per day and by the end of the month would predict 300 sales (30 day month) or 310 sales in a (31 day month) and so on... 

 

I have the item TotalSalesMonth as I have already suggested and imagine I will use EOMonth and Today for time intelligence. Please advise? 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @andrewb95 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create two measures as below.

TotalSalesMonth To Date = 
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        ALL('Table'),
        [Date]<=MAX('Table'[Date])&&
        FORMAT([Date],"mmm yyyy")=FORMAT(MAX('Table'[Date]),"mmm yyyy")
    )
)

 

Forecast TotalSalesMonth = 
var _days = DAY(EOMONTH(MAX('Table'[Date]),0))
var _avg = 
CALCULATE(
    AVERAGE('Table'[Value]),
    FILTER(
        ALL('Table'),
        'Table'[Date]<=MAX('Table'[Date])&&
        FORMAT([Date],"mmm yyyy")=FORMAT(MAX('Table'[Date]),"mmm yyyy")
    )
)
return
_avg*_days

 

Result:

d2.png

 

Best Regards

Allan

 

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

1 REPLY 1
v-alq-msft
Community Support
Community Support

Hi, @andrewb95 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create two measures as below.

TotalSalesMonth To Date = 
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        ALL('Table'),
        [Date]<=MAX('Table'[Date])&&
        FORMAT([Date],"mmm yyyy")=FORMAT(MAX('Table'[Date]),"mmm yyyy")
    )
)

 

Forecast TotalSalesMonth = 
var _days = DAY(EOMONTH(MAX('Table'[Date]),0))
var _avg = 
CALCULATE(
    AVERAGE('Table'[Value]),
    FILTER(
        ALL('Table'),
        'Table'[Date]<=MAX('Table'[Date])&&
        FORMAT([Date],"mmm yyyy")=FORMAT(MAX('Table'[Date]),"mmm yyyy")
    )
)
return
_avg*_days

 

Result:

d2.png

 

Best Regards

Allan

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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