cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors