Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a table that has Group, Sales Person, Service Score. I am trying to find a way to calculate the average Service Score by Group and then Count the number of Groups that have an Average Service Score above 6. I have tried to figure out a way to use SUMMARIZE or GROUPBY to make this happen but those functions are new to me and I can't seem to get them to work. Below is an example of the table.
Group | Employee ID | Service Score |
Group A | 001 | 5 |
Group B | 002 | 10 |
Group C | 003 | 7 |
Group A | 004 | 3 |
Group C | 005 | 6 |
I know I can make a table that shows the average score by group but what I need is the count of Groups with an average score over 6 because my end metric is Percentage of Groups with an average Service Score above 6.
In this example Group A average score = 4, Group B average score = 10, and Group C average score = 6.5 so
Count of Groups with average score above 6 = 2 and percentage of Groups with average scores above 6 = 67% (2/3)
Solved! Go to Solution.
DEFINE
MEASURE 'Service Scores'[Total Score] =
SUM( 'Service Scores'[Service Score] )
MEASURE 'Service Scores'[Average Score by Group] =
AVERAGEX(
DISTINCT( 'Service Scores'[Group] ),
CALCULATE(
AVERAGE( 'Service Scores'[Service Score] ),
REMOVEFILTERS('Service Scores'[ Employee ID] )
)
)
MEASURE 'Service Scores'[Average Score > 6] =
[Average Score by Group] > 6
MEASURE 'Service Scores'[# Groups with Avg Score > 6] =
SUMX(
DISTINCT('Service Scores'[Group] ),
IF( [Average Score > 6], 1 )
)
Thanks for your response but I am getting the error "To use special characters in a measure, enclose the entire name in brackets and add a ] to any closing brackets in the name."
Below is what I typed in:
DEFINE
MEASURE 'Customer Responses_2022'[TotalScore] =
SUM('Customer Responses_2022'[Score])
MEASURE 'Customer Responses_2022'[AvgScore by Group] =
AVERAGEX(
DISTINCT('Customer Responses_2022'[Group ID]),
CALCULATE(
AVERAGE('Customer Responses_2022'[Score]),
REMOVEFILTERS('Customer Responses_2022'[Employee ID])
)
)
MEASURE 'Customer Responses_2022'[AvgScore 6 or Above] =
[AvgScore by Group] >=6
MEASURE 'Customer Responses_2022'[Count of Groups 6 or Above] =
SUMX(
DISTINCT('Customer Responses_2022'[Group ID]),
IF([AvgScore 6 or Above],1)
)
Hi @BeeTee
If your soft says "To use special characters in a measure, enclose the entire name in brackets and add a ] to any closing brackets in the name.", then you should revise your code and look for such unusual characters (remember that some chars are non-printable). The code I gave you works on my station perfectly. I can't help you any more than that since I don't have access to your project. You've got to figure it out by yourself.
Sorry 😞
DEFINE
MEASURE 'Service Scores'[Total Score] =
SUM( 'Service Scores'[Service Score] )
MEASURE 'Service Scores'[Average Score by Group] =
AVERAGEX(
DISTINCT( 'Service Scores'[Group] ),
CALCULATE(
AVERAGE( 'Service Scores'[Service Score] ),
REMOVEFILTERS('Service Scores'[ Employee ID] )
)
)
MEASURE 'Service Scores'[Average Score > 6] =
[Average Score by Group] > 6
MEASURE 'Service Scores'[# Groups with Avg Score > 6] =
SUMX(
DISTINCT('Service Scores'[Group] ),
IF( [Average Score > 6], 1 )
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |