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
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

15 REPLIES 15
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.

This worked for my issue. Thanks! 

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.

 

 

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).

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 !

Hi there,

I'm new here but I think you can use AVERAGEX to solve your problem, I've read the documentation and it says this in there.

 

The AVERAGEX function can take as its argument an expression that is evaluated for each row in a table. This enables you to perform calculations and then take the average of the calculated values.

Hello @AtlasDLion , the reply Accepted as Solution in this legacy post added in 2016 used AVERAGEX in the DAX formula demonstrated by both @Habib and @jahida . 

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.