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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
thomas_pike
Frequent Visitor

Count of Filtered Counts

Good Evening,

 

I'm trying to write a DAX expression that counts the number of IDs that occur twice or more in a table.

 

For instance:

ID
A
B
C
A
B
A

 

...should return 2 as both A and B occur twice or more in the column.  Thanks for your assistance.

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

=
COUNTROWS(
    FILTER( VALUES( DATA[ID] ), CALCULATE( COUNTROWS( DATA ) ) > 1 )
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

ManguilibeKAO
Resolver I
Resolver I

Hi,

 

You can use this measure:

Mesm=
Var t = SUMMARIZE('Table','ID',"Cnt",CountRows('Table'))

Return

 CountRows(FILTER(t,[Cnt] >=2))

 

 

And, after creating the measure, you can use a card and drag ( or dispaly) the measure on the card, and you'll see the count you are looking for.

 

Best regards. 

Anonymous
Not applicable

Hello

 

Try this

Countdoubleormore = countrows(filter(summarize('Table','Table'[id],"@nb",COUNTA('Table'[id])),[@nb]>1))

measure

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors