Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello community,
I'm stuck on a measure in DAX and I hope to get some help.
To make it simple, I have a table with the column "Name" which contains a unique identifier.
Each name is associated with a group in the "Group" column.
I'm looking for the number of groups for which there are more than 5 names.
In relation to the table below, the expected result would therefore be 3 groups for which I have 5 or more names.
| Name | Group |
| TOTO_1 | A |
| TOTO_2 | A |
| TOTO_3 | A |
| TOTO_4 | A |
| TOTO_5 | A |
| TOTO_6 | B |
| TOTO_7 | B |
| TOTO_8 | B |
| TOTO_9 | B |
| TOTO_10 | C |
| TOTO_11 | C |
| TOTO_12 | C |
| TOTO_13 | D |
| TOTO_14 | D |
| TOTO_15 | D |
| TOTO_16 | D |
| TOTO_17 | D |
| TOTO_18 | E |
| TOTO_19 | F |
| TOTO_20 | G |
| TOTO_21 | H |
| TOTO_22 | I |
| TOTO_23 | J |
| TOTO_24 | J |
| TOTO_25 | J |
| TOTO_26 | J |
| TOTO_27 | J |
| TOTO_28 | J |
Thank you in advance for helping me to find the right measure.
Solved! Go to Solution.
You can create a measure like
Num groups > 5 =
var summaryTable = ADDCOLUMNS( VALUES( 'Table'[Group]), "@num rows", CALCULATE( COUNTROWS('Table') )
return COUNTROWS( FILTER( summaryTable, [@num rows] > 5) )
Hi @johnt75
Thank you for your help and speed.
It has helped me a lot and I am getting what I want.
You just forgot one ) after the CALCULATE( COUNTROWS('Table') ) ) but no worries.
Num groups > 5 =
var summaryTable = ADDCOLUMNS( VALUES( 'Table'[Group]), "@num rows", CALCULATE( COUNTROWS('Table') ) )
return COUNTROWS( FILTER( summaryTable, [@num rows] > 5) )
Hi,
Please check the below picture and the attached pbix file.
Count of groups that have more than five names: =
COUNTROWS (
FILTER (
GROUPBY ( Data, Data[Group], "@namecount", SUMX ( CURRENTGROUP (), 1 ) ),
[@namecount] >= 5
)
)
Hi,
Please check the below picture and the attached pbix file.
Count of groups that have more than five names: =
COUNTROWS (
FILTER (
GROUPBY ( Data, Data[Group], "@namecount", SUMX ( CURRENTGROUP (), 1 ) ),
[@namecount] >= 5
)
)
You can create a measure like
Num groups > 5 =
var summaryTable = ADDCOLUMNS( VALUES( 'Table'[Group]), "@num rows", CALCULATE( COUNTROWS('Table') )
return COUNTROWS( FILTER( summaryTable, [@num rows] > 5) )
Hi @johnt75
Thank you for your help and speed.
It has helped me a lot and I am getting what I want.
You just forgot one ) after the CALCULATE( COUNTROWS('Table') ) ) but no worries.
Num groups > 5 =
var summaryTable = ADDCOLUMNS( VALUES( 'Table'[Group]), "@num rows", CALCULATE( COUNTROWS('Table') ) )
return COUNTROWS( FILTER( summaryTable, [@num rows] > 5) )
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 8 | |
| 8 | |
| 8 | |
| 8 |