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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors