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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
joshua1990
Post Prodigy
Post Prodigy

Actuals Total vs Forecast per Week

Hi experts!

I am no sure how this concept is called but I need to calculate the how much of the actuals fall into WK01, WK02 etc. Forecast.

The table is presented in the following way:

ProductWK01WK02WK03Actuals
A55040700600
B600300300500
C05000250

 

Now I need to calculcate the amout per week that is covered by the actuals like this:

ProductWK01WK02WK03ActualsActuals WK01Actuals WK02Actuals WK03
A550407006005504010
B60030030050050000
C0500025002500

 

I would need a measure for Actuals WK01, WK02 and WK03.

 

How would you calculate ?

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hello @joshua1990 ,
Thank you for reaching out to the Microsoft Fabric Forum Community.

I have reproduced your scenario using sample data, and I was able to achieve the expected result you're aiming for where the Actuals are distributed across WK01, WK02, WK03, etc., based on forecast priority.

I created calculated columns to distribute the Actuals across the forecast weeks sequentially, reducing the remaining actuals each step.

DAX i have used:

  • Actuals WK01
Actuals WK01 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

RETURN IF(A >= W1, W1, A)

 

  • Actuals WK02
Actuals WK02 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

VAR W2 = ForecastData[WK02]

VAR Remaining = A - W1

RETURN IF(Remaining > 0, IF(Remaining >= W2, W2, Remaining), 0)

 

  • Actuals WK03
Actuals WK03 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

VAR W2 = ForecastData[WK02]

VAR W3 = ForecastData[WK03]

VAR Remaining = A - W1 - W2

RETURN IF(Remaining > 0, IF(Remaining >= W3, W3, Remaining), 0)

 

You can easily extend this same logic for additional weeks like WK04, WK05, etc., by continuing the same pattern.

I’m attaching the output screenshot and .pbix file for your reference:

vssriganesh_0-1744349584404.png


If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

View solution in original post

6 REPLIES 6
v-ssriganesh
Community Support
Community Support

Hi @joshua1990,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

Sahir_Maharaj
Super User
Super User

Hello @joshua1990,

 

Could you please try this approach:

-- Actuals WK01
Actuals WK01 = 
VAR Actuals = 'Table'[Actuals]
VAR WK01 = 'Table'[WK01]
RETURN MIN(Actuals, WK01)

-- Actuals WK02
Actuals WK02 = 
VAR Actuals = 'Table'[Actuals]
VAR UsedWK01 = MIN(Actuals, 'Table'[WK01])
VAR Remaining = Actuals - UsedWK01
VAR WK02 = 'Table'[WK02]
RETURN MIN(Remaining, WK02)

-- Actuals WK03
Actuals WK03 = 
VAR Actuals = 'Table'[Actuals]
VAR UsedWK01 = MIN(Actuals, 'Table'[WK01])
VAR RemainingAfterWK01 = Actuals - UsedWK01
VAR UsedWK02 = MIN(RemainingAfterWK01, 'Table'[WK02])
VAR Remaining = RemainingAfterWK01 - UsedWK02
VAR WK03 = 'Table'[WK03]
RETURN MIN(Remaining, WK03)

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,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
v-ssriganesh
Community Support
Community Support

Hello @joshua1990,

Could you please confirm if your query have been resolved? If they have, kindly mark the helpful response and accept it as the solution. This will assist other community members in resolving similar issues more efficiently.

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @joshua1990 ,
Thank you for reaching out to the Microsoft Fabric Forum Community.

I have reproduced your scenario using sample data, and I was able to achieve the expected result you're aiming for where the Actuals are distributed across WK01, WK02, WK03, etc., based on forecast priority.

I created calculated columns to distribute the Actuals across the forecast weeks sequentially, reducing the remaining actuals each step.

DAX i have used:

  • Actuals WK01
Actuals WK01 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

RETURN IF(A >= W1, W1, A)

 

  • Actuals WK02
Actuals WK02 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

VAR W2 = ForecastData[WK02]

VAR Remaining = A - W1

RETURN IF(Remaining > 0, IF(Remaining >= W2, W2, Remaining), 0)

 

  • Actuals WK03
Actuals WK03 =

VAR A = ForecastData[Actuals]

VAR W1 = ForecastData[WK01]

VAR W2 = ForecastData[WK02]

VAR W3 = ForecastData[WK03]

VAR Remaining = A - W1 - W2

RETURN IF(Remaining > 0, IF(Remaining >= W3, W3, Remaining), 0)

 

You can easily extend this same logic for additional weeks like WK04, WK05, etc., by continuing the same pattern.

I’m attaching the output screenshot and .pbix file for your reference:

vssriganesh_0-1744349584404.png


If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

Hi @joshua1990,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.

ahmetyilmaz
Advocate II
Advocate II

Hi, can you explain how you obtained the data in table 2?

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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