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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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