Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jerome_C
Regular Visitor

DAX Measure needs Help

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.

 

NameGroup
TOTO_1A
TOTO_2A
TOTO_3A
TOTO_4A
TOTO_5A
TOTO_6B
TOTO_7B
TOTO_8B
TOTO_9B
TOTO_10C
TOTO_11C
TOTO_12C
TOTO_13D
TOTO_14D
TOTO_15D
TOTO_16D
TOTO_17D
TOTO_18E
TOTO_19F
TOTO_20G
TOTO_21H
TOTO_22I
TOTO_23J
TOTO_24J
TOTO_25J
TOTO_26J
TOTO_27J
TOTO_28J

 

Thank you in advance for helping me to find the right measure.

3 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

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) )

View solution in original post

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) )

 

 

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

Count of groups that have more than five names: =
COUNTROWS (
    FILTER (
        GROUPBY ( Data, Data[Group], "@namecount", SUMX ( CURRENTGROUP (), 1 ) ),
        [@namecount] >= 5
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

Count of groups that have more than five names: =
COUNTROWS (
    FILTER (
        GROUPBY ( Data, Data[Group], "@namecount", SUMX ( CURRENTGROUP (), 1 ) ),
        [@namecount] >= 5
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

Your solution also works.
Thank you

johnt75
Super User
Super User

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) )

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.