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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
RandomUserPby
Regular Visitor

Count ID with only one element associated

Hello,
I have a table like this :

RandomUserPby_0-1682003029184.png

and I want to count IDs where I only have a pig associated with (so, in my example, ID 2 is an ID with only pig and nothing else)

I think its very easy to do in DAX but idk how to do it... 

Thanks you.

 

4 REPLIES 4
Anonymous
Not applicable

could you try this:

PigCount = calculate(countrows('Table'),'Table'[Animal]="Pig" && count('Table'[ID])=1)

Hello, not good !

Anonymous
Not applicable

Have you tried putting the dax formula on a calculated column?

Yes, it don't work

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors