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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.