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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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