Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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) )
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |