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
oroussel
New Member

How to calculate a sum of averages ?

Dear PBI community

 

As introduction, I'm new user that need help as I did not find on forum. my request is the opposite of tradionnal "average of sums..."

 

Here we go : I created a matrix to get average prices ("prix" calculted by "Val €" / "Qtes T" (see below)

 

The 3 lines represents successives operations of same product transformation. Consequently, to get the total price, I need to sum the individual prices. Means that, instead of returning 65.33€, I'm expecting to get 148.66€ (sum of 81.45 + 52.21 + 15.00). I tried to create new measures or columns but failed to create the right formula...

 

In second step, "Qtés" total could be also re-calculated also based on formula "Val €" / "Price €") to get a coherent information but I'm not sure this is possible...

 

Thanks for your help !

 

Pic PBI subtotal 2.jpg

Olivier

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

HI @oroussel,

 

The Prix is a measure?

When you use a measure the value are always recalculated based on the variable you have so in the total you will have:

-165352 € / 2531 = 65.33 that it's the value you are getting.

 

You need to add the same formula but as a clomun and then add it to you matrix and you will get the 145 since making it a column it wil do the calculation for each row individually independtly of the variable you put in the Matrix.

 

Regards,

 

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

Hi MFelix

 

That worked! I added a column as recommended but also modified my formula by deleting the SUM function intially included. I'll try now to play with colums features to discover more!

 

Many thanks for quick answer

 

Olivier 

View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

HI @oroussel,

 

The Prix is a measure?

When you use a measure the value are always recalculated based on the variable you have so in the total you will have:

-165352 € / 2531 = 65.33 that it's the value you are getting.

 

You need to add the same formula but as a clomun and then add it to you matrix and you will get the 145 since making it a column it wil do the calculation for each row individually independtly of the variable you put in the Matrix.

 

Regards,

 

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix

 

That worked! I added a column as recommended but also modified my formula by deleting the SUM function intially included. I'll try now to play with colums features to discover more!

 

Many thanks for quick answer

 

Olivier 

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.