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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.