cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aktripathi2506
Helper IV
Helper IV

Average of measure

Hi,

 

I calculated the measure for quarter 1 and quarter 2.

Where each value is basically the average of 13 weeks values for each group.

Now I want to calculate the average of only these values which are displayed in the visual table.

 

Group Name2016-Quarter 12016-Quarter 2
A96.99%87.86%
B97.88%98.98%
C98.46%97.57%
D99.20%99.86%
E100.00%100.00%
F98.51%98.75%
G  
H94.41%94.13%
I89.69%96.48%
G98.84%97.76%
K99.69%99.25%
L99.64%99.13%
M96.37%95.08%
N94.81%97.64%
1 ACCEPTED SOLUTION
jahida
Impactful Individual
Impactful Individual

I think Habib's measure (or something similar) will work, but repeating the code seems like awful style...

 

Can you just do something like

 

Measure2 = AVERAGEX(SUMMARIZE(Table, Table[GroupName], "toAverage", [Measure]), [Measure])

 

? If you don't need the initial measure at all, then you could in-line the code, but even in that case I think splitting it out adds some clarity (it's hard enough to read as it is).

View solution in original post

12 REPLIES 12
aditya118
Regular Visitor

I want to calculate the average of a measure over my entire data(basically without any grouping) and I am not able to perform it by current solution provided. This is required as the visual I am using doesn't supports an average line.

Just turn it into a calculated column instead of a measure.

Habib
Responsive Resident
Responsive Resident

You can use CALCULATE and apply filter for ALLSELECTED. Your formula will look like

 

New Measure = CALCULATE(AVERAGE([column]),ALLSELECTED([table or column]))

Thank you for reply.

I have measure which has been calculated already, I want the average of these mesaures.

The option you suggested is not working.

 

Any other suggestions guys?

hi @aktripathi2506

 

Dou you have 1 measure or 2 measure?

 

If you have 2 you can do this:

 

NewMeasure=DIVIDE([Measure1]+[Measure2];2)

 

 




Lima - Peru

hi @Vvelarde,

 

I think I did not explained well.. you misunderstood me.

There is only one measure for different groups A, B, C, D...

 

My raw data is having columns

 

WeekHours spentTotal available Hours
1250
2250
3350
4480
5880
612100

 

 

Measure calculate average of efficiency of hours spent (1 - Hour spent/Total available Hours) for 13 weeks for each groups.

by using the following formula:

Measure = AVERAGEX(SUMMARIZE(Table, Table[week], "Sum of Hours", SUM(Table[hours spent]), "Average available", AVERAGE(Table[Available hours for the week])), 1 - DIVIDE([Sum of Hours], [Average available]))

 

As a result I get this:

 

Group Name2016-Quarter 1
A96.99%
B97.88%
C98.46%
D99.20%
E100.00%
F98.51%
G 
H94.41%
I89.69%
G98.84%
K99.69%
L99.64%
M96.37%
N94.81%
Average97.27%

 

 

Now I want to calculate the average of these measure for different groups together shown in the table.

So basically my desired output is 97.27 in this example. Average of the measure for different groups.

 

 

Habib
Responsive Resident
Responsive Resident

Now if I understood correctly, you want average of all groups and that should remain same whatever selection you made?

 

Please add a new measure which should be copy of exisitng measure and add CALCULATE function along with filters..... something like this.

 

AvgMeasure = CALCULATE(AVERAGEX(SUMMARIZE(Table, Table[week], "Sum of Hours", SUM(Table[hours spent]), "Average available", AVERAGE(Table[Available hours for the week])), 1 - DIVIDE([Sum of Hours], [Average available])),ALL(GroupName))

 

change the red text to whatever your table name is for Groups. This will give you average of all groups.

jahida
Impactful Individual
Impactful Individual

I think Habib's measure (or something similar) will work, but repeating the code seems like awful style...

 

Can you just do something like

 

Measure2 = AVERAGEX(SUMMARIZE(Table, Table[GroupName], "toAverage", [Measure]), [Measure])

 

? If you don't need the initial measure at all, then you could in-line the code, but even in that case I think splitting it out adds some clarity (it's hard enough to read as it is).

View solution in original post

here the problem to overcame is : having already a calculated Measure HOW is possible to get the average? the DAX function average takes just column as input not measure ! so the question is not find another way to calculate my measurement BUT how make the average of it !

Anonymous
Not applicable

It worked!

However, I only can apply this measure for one group, right? In my case, I chose by date. But I also want to see the result by name.

Is there some way to do it by 2 groups?

So what did you do, did you use it as calculated column?

I am in the same situation tight now.

I created a measure as 

Mentor_Score = CALCULATE(([.Mentor_Prep]*0.25) + ([.Mentor_Experience] * 0.25) + ([.Mentor_NPS] * 0.5) * 1.00)
Now I want to find the average Mentor_Score per month and year, please how do I achieve this?

Hi,

 

I think I am having a similar problem.

What was the best solution?

 

Regards,

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors