Forum Discussion
Calculating average of measures
- 10 years ago
Asumming you don't have that summary table built out and you just want to plug the initial table into a matrix or table visual, here's a measure you can use (might be minor syntax errors, I'm not testing but I'm pretty sure the concept is sound):
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]))
Have you tried either of the methods we suggested?
Yes I tried your its not giving me the expected result. I thought about creating the new column before as well but it is difficult because: you have to get the sum of hours grouping by week and then divide it by the average of available hours group by week.
In a new column i can not do [hours spent/available hours for each week] for each row because that will give me different value.
- jahida10 years ago
Impactful Individual
What do you have in PowerBI right now? Do you only have one table or have you built out that summary table at all yet? I think both of us assumed you had that summary table built out, which might be incorrect.
- jahida10 years ago
Impactful Individual
Asumming you don't have that summary table built out and you just want to plug the initial table into a matrix or table visual, here's a measure you can use (might be minor syntax errors, I'm not testing but I'm pretty sure the concept is sound):
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]))
- aktripathi250610 years ago
Helper IV
Awesome. This is great.
Very good logic, solved the problem.
Thanks a lot truely.
- aktripathi250610 years ago
Helper IV
In power BI I have the first table in my previous post refered as raw data.
That summary table I have given is just for understanding point of view (Excel way).
I want to do all this calculation in power BI, in excel it is easy to do, thats why I gave example by excel that how to achieve the desired result.
- jahida10 years ago
Impactful Individual
Yeah ok my bad for misunderstanding. Did you try the most recent measure?