Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
I'm new to powerbi. I'm trying to create a measure that will only count with Score(% Score) average of >=90% by ID. A distinct value on column "ID". Kindly refer to the attached image. Your help is greatly appreciated.
Solved! Go to Solution.
Hi @MacyMolly try this:
NewMeasure =
VAR _distinctCount =
DISTINCTCOUNT ( 'Table'[ID] ) //Count how many ids
VAR _summarizeTable =
SUMMARIZECOLUMNS (
'Table'[ID],
'Table',
"Average",
IF ( AVERAGE ( 'Table'[%Score] ) >= .9, 1, 0 ) //if equal to or greater than .9 give it a 1
)
VAR _passingCount =
SUMX ( _summarizeTable, [Average] )
VAR _calc =
DIVIDE ( _passingCount, _distinctCount ) //Sum the average column from the table above and divide it by the total of ids
RETURN
_calc
and if you just want the passing count, return _passingCount instead of _calc
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi @MacyMolly , and if you use essentially the same measure, but just return the _calc, you will have the averages.
myMeasureAverage =
VAR _curID =
MAX ( 'Table'[ID] )
VAR _calc =
CALCULATE (
AVERAGE ( 'Table'[%Score] ),
FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), MAX ( 'Table'[ID] ) = _curID )
)
RETURN
_calc
Bonus!
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi @Nathaniel_C, I'm sorry. I think I wasn't able to express myself very well. Well, I only want to create a measure that will count of all the distinct ID that able to achieved an average score of >= 0.90. I have a filter that can select multi weeks.
1. distinctcount ( ID)
2. only count each distinct ID if they passed the score of >= .90
3. Get the passing rate: total count of distinct ID who passed divided by the distinctcount(ID)
Hi @MacyMolly try this:
NewMeasure =
VAR _distinctCount =
DISTINCTCOUNT ( 'Table'[ID] ) //Count how many ids
VAR _summarizeTable =
SUMMARIZECOLUMNS (
'Table'[ID],
'Table',
"Average",
IF ( AVERAGE ( 'Table'[%Score] ) >= .9, 1, 0 ) //if equal to or greater than .9 give it a 1
)
VAR _passingCount =
SUMX ( _summarizeTable, [Average] )
VAR _calc =
DIVIDE ( _passingCount, _distinctCount ) //Sum the average column from the table above and divide it by the total of ids
RETURN
_calc
and if you just want the passing count, return _passingCount instead of _calc
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi @MacyMolly , you are welcome!
Nathaniel
Proud to be a Super User!
Hi @MacyMolly ,
myMeasurecount =
VAR _curID =
MAX ( 'Table'[ID] )
VAR _calc =
CALCULATE (
AVERAGE ( 'Table'[%Score] ),
FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), MAX ( 'Table'[ID] ) = _curID )
)
RETURN
IF ( _calc >= .90, 1, 0 )
Try this.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
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 |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |