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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
marco_cers
Regular Visitor

Month of Sales calculation

Hello everyone,

I'm trying to find my way in solving the below request, any support is really appreciated!

 

What I'm trying to do is set up a Measure on Power BI that calculates the Stock coverage. The general formula is the following:

 

MoS = Stock measure / (Average Sales in Month N+1 / N+2 / N+3)

 

The Denominator is what I can't get my head around because depending on the forecast cycle I choose and the availability of data I have, I need to tell Power BI what to consider as 3 Months sales. 2 examples below may help explain my doubts further:

 

1. 2022 December actuals will now need to consider Jan, Feb, Mar 2023 as Sales for the Denominator, based on the forecast that was submitted now in January. Next month I still need 2022 December MoS to take Jan, Feb and Mar Sales, but I need to recalculate based on a different Cycle (the one we will do in February that has January actuals). So I need the formula to be dynamic

 

2. I only have forecasts up to 2023 so as I approach the end of the year I need to take into consideration the last 3 months available (so October/November/December MoS will take the last 3 months' sales as denominator rather than the N+1/N+2/N+3)

 

I tried approaching the problem above with a supporting table to try and set out the rules. As you can see below, at a given cycle, month and year, I should be able to establish the corresponding cycle, month and year of the Sales I need at the denominator:

 

CycleMonthYearKeyMonth 1Month 2Month 3
PO_01_2023Jan2023PO_01_2023Jan2023PO_01_2023Feb2023PO_01_2023Mar2023PO_01_2023Apr2023
PO_01_2023Feb2023PO_01_2023Feb2023PO_01_2023Mar2023PO_01_2023Apr2023PO_01_2023May2023
PO_01_2023Mar2023PO_01_2023Mar2023PO_01_2023Apr2023PO_01_2023May2023PO_01_2023Jun2023
PO_01_2023Apr2023PO_01_2023Apr2023PO_01_2023May2023PO_01_2023Jun2023PO_01_2023Jul2023
PO_01_2023May2023PO_01_2023May2023PO_01_2023Jun2023PO_01_2023Jul2023PO_01_2023Aug2023
PO_01_2023Jun2023PO_01_2023Jun2023PO_01_2023Jul2023PO_01_2023Aug2023PO_01_2023Sep2023
PO_01_2023Jul2023PO_01_2023Jul2023PO_01_2023Aug2023PO_01_2023Sep2023PO_01_2023Oct2023
PO_01_2023Aug2023PO_01_2023Aug2023PO_01_2023Sep2023PO_01_2023Oct2023PO_01_2023Nov2023
PO_01_2023Sep2023PO_01_2023Sep2023PO_01_2023Oct2023PO_01_2023Nov2023PO_01_2023Dec2023
PO_01_2023Oct2023PO_01_2023Oct2023PO_01_2023Oct2023PO_01_2023Nov2023PO_01_2023Dec2023
PO_01_2023Nov2023PO_01_2023Nov2023PO_01_2023Oct2023PO_01_2023Nov2023PO_01_2023Dec2023

 

Thanks again for your support!

 

Best,

Marco

 

0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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