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
Ankur
Regular Visitor

Need Group average at Row level in Table/Matrix

Hi,

 

We are building a sales comparision report across the terrority by salesperson. We need the group average sales to be availalbe at each row, so what we can compare individual salesperson performance against the average.

 

We need the below two higllighed colums :

Power BI - Query.JPG

 

 

 

 

 

 

Many thanks !

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Ankur
Add this two measures two your table:

Average_Total = CALCULATE(AVERAGE(Sales[Amount]),ALLSELECTED(Sales))

Average difference = SUM(Sales[Amount])-[Average_Total]
Then add them to your visual.

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

mattbrice
Solution Sage
Solution Sage

Can you try this:

 

Grp Avg =
CALCULATE (
    AVERAGEX ( VALUES ( Table[Salesman] ), [Amount] ),
    ALL ( Table[Salesman] )
)
Difference = [Amount] - [Grp Avg]

View solution in original post

7 REPLIES 7
mattbrice
Solution Sage
Solution Sage

Can you try this:

 

Grp Avg =
CALCULATE (
    AVERAGEX ( VALUES ( Table[Salesman] ), [Amount] ),
    ALL ( Table[Salesman] )
)
Difference = [Amount] - [Grp Avg]

Hi @MFelix , @mattbrice,

 

Did some small change and it worked :

 

Group_Average = CALCULATE(SUM(Sales[Amount]),ALLSELECTED(Sales)) / 8

 

Divided the result by the no. of salesman. Now the result is what we wanted.

 

Power BI - Query Solved.JPG

 

 

 

Many Thanks.

 

MFelix
Super User
Super User

Hi @Ankur
Add this two measures two your table:

Average_Total = CALCULATE(AVERAGE(Sales[Amount]),ALLSELECTED(Sales))

Average difference = SUM(Sales[Amount])-[Average_Total]
Then add them to your visual.

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



Hello @MFelix,

 

We deployed the formula you suggested, below are the results we get :

 

Power BI - Query 2.1.JPG

 

 

 

 

 

 

Thanks,

Ankur

 

 

Is the average field on your table a calculation or a value in the data base?

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,

 

It is a calculation field, based on Amount field.

Can you share the formula?

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



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!

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.