cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sbharti Occasional Visitor
Occasional Visitor

Getting Average of averages as a new column

I have a requirement from business wherein I need to show average of averages in a new column. My data is almost similar to the image below:image.pngemp.csv

Now, I have created report wherein I have a filter through which we can select Q1 or Q2. Once a question is selected, we need to show average of that question for each employee. That was easy for me, with a new measure as:

 

Each_AVG = SWITCH(SELECTEDVALUE(QList[QNO]), "Q1", AVERAGE(Emp[Q1]), AVERAGE((Emp[Q2])))

This works fine and I get an output as:

 

image.pngPower BI Report

Now, I don't need to show total, but a new column which shows average of averages. The above total is not what we need, not the overall average value.. But I need to add a new measure as a column in above which shows  (2.5+1.67+3.00)/3 = 2.39

 

I am able to display 2.33 using AverageX but just can't figure out how to show this average of averages..

 

Any help would be greatly appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Getting Average of averages as a new column

Oh yes, very possible.  Use a measure like this and add it to your table:

Avg of AVG = 
    AVERAGEX(
        SUMMARIZE(ALL(Employee),Employee[Name],"Average", [AVG]),
        [Average]
    )

This will evaluate against all names whenever your original [AVG] evaluates.  If you have other filters on your data, you may want to use ALLEXCEPT to keep those applied.

 

 

 

View solution in original post

7 REPLIES 7
Super User IV
Super User IV

Re: Getting Average of averages as a new column

Hi,

Try this measure

=AVERAGEX(ALL(Data[Name]),[Each_Avg])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Microsoft v-cherch-msft
Microsoft

Re: Getting Average of averages as a new column

Hi @sbharti 

You may use ISFILTERED function to change the total.For example:

Measure = IF(ISFILTERED(Emp[Name]),[Each_AVG],AVERAGEX(ALL(Emp[Name]),Emp[Each_AVG]))

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
sbharti123 Frequent Visitor
Frequent Visitor

Re: Getting Average of averages as a new column

This doesn't work for me. From this formula I am able to get average of averages at the bottom, where the total is shown.

 

However, I need to add a new column to the tabular visualization which just shows one value, the average of averages. Is that possible?

 

The solution by Ashish works for me in this dummy data report. But when I implement that on the actual report I just get the same individual averages on each row.

 

I am really stuck at this point. 

Super User III
Super User III

Re: Getting Average of averages as a new column

Do you want the Average of Averages value displayed once, or in each row of data?

 

For each row of data, you would use a measure and add that to your table.  If you only want it displayed once,  your best bet is to make the same measure and display it in a card, and try to match the formatting to your table.

 

 

If you could make a mockup of what your desired result would look like in Excel, we could give better info.

sbharti123 Frequent Visitor
Frequent Visitor

Re: Getting Average of averages as a new column

I have input data as below:

 

image.png

 

There are other Q values like Q2, Q3... which will be chosen by a filter.  I then need to display each employee's individual average for the question selected in slicer. I can get that done by below code:

 

AVG = SWITCH(SELECTEDVALUE(QList[QNO]), "Q1", AVERAGEX(Employee,[Q1]), AVERAGEX(Employee,[Q2]))

Now, in the tabular report, I need to display the average of averages, something like below:

 

image.png

 

If you note the average of averages is = (2.5+2.33+2.33)/3

 

By using below measure, what I get is an overall average, by summing all values in a question and dividing by count of values:

 

AVERAGEX(ALLSELECTED(Employees) , Employees[AVG])

How can I get this done.. It is something very straightforward in SQL like:

 

SELECT name, AVERAGE(AVG) FROM (
SELECT name, AVERAGE(q1) AS AVG FROM Employee
GROUP BY name) temp

 

Do you think its possible?

 

 

Highlighted
Super User III
Super User III

Re: Getting Average of averages as a new column

Oh yes, very possible.  Use a measure like this and add it to your table:

Avg of AVG = 
    AVERAGEX(
        SUMMARIZE(ALL(Employee),Employee[Name],"Average", [AVG]),
        [Average]
    )

This will evaluate against all names whenever your original [AVG] evaluates.  If you have other filters on your data, you may want to use ALLEXCEPT to keep those applied.

 

 

 

View solution in original post

sbharti123 Frequent Visitor
Frequent Visitor

Re: Getting Average of averages as a new column

Dear Cmcmahan,

 

That was perfect. It resolved the issue.

 

Thank you so much..

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors