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
Asa94
Helper I
Helper I

Calculating the Sum of the Weighted Average with set Weighted Factors over a 6 month period

Hi everyone,

 

I have been trying to figure out how to calculate a sum of the wieghted averages over a 6 month period.

 

Asa94_0-1620801825894.png

Basically, I have sales file which has data for the past 6 months of the demand for pieces:

 

- Each month has the demand for the number of pieces

- Each month has a Weight Factor attached to it (This is a set factor)

- The weighted demand is calculated by the demand (in pieces) multiplied by the Weight factor for that month

 

= In the end, I have to sum all of the weighted demand.

 

My question would be how to associate the months with the weighted factor in the best way possible? Would it be best for me to create a new table and assign the months to an index? Any ideas would be helpful 🙂

 

Kind Regards,

Asa

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Asa94 

I tried to create a sample pbix file based on the explanation.

Please check the below picture and the sample pbix file's link down below.

All measures are in the sample pbix file.

 

Picture2.png

 

 

https://www.dropbox.com/s/lei4h3n0oftbgx7/asa.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

7 REPLIES 7
Asa94
Helper I
Helper I

Hi @amitchandak and @Jihwan_Kim,

 

Thank you both for your replies. It is really appreciated 🙂

 

@Jihwan_Kim that file really helped to visualise and understand your logic! If I may, I do have further questions with regards to 1 or 2 measures :). Thank you again for the file and how quickly you done it 😮

Hi, @Asa94 

Thank you for your feedback.

Please let me know your questions.

Thank you very much.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim ,

 

Cool, the 'Demand total by custom month' measure is quite interesting. Is it possible to go through it step by step?

 

Thank you

Hi, @Asa94 

Please check the link down below.

I tried to comment inside the measure.

Please open the measure and you can see the comments that I wrote.

Thank you.

 

https://www.dropbox.com/s/lei4h3n0oftbgx7/asa.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim 

 

Thank you so much! This has been such a great help!

Jihwan_Kim
Super User
Super User

Hi, @Asa94 

I tried to create a sample pbix file based on the explanation.

Please check the below picture and the sample pbix file's link down below.

All measures are in the sample pbix file.

 

Picture2.png

 

 

https://www.dropbox.com/s/lei4h3n0oftbgx7/asa.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@Asa94 , You need to have common date or month column to join both demand and weight table, then you can try measure like

 

Sumx(values(Month[Month), sum(Demand[value]) * max(Table[Weight Factor]))

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.