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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cmck
Frequent Visitor

Evaluate values in column B, for each distinct value in column A and return result in column C

Hi, 

 

I am trying to make a new column for my dataset. Below is a basic representation of my data. 

 

In column C (ready to go home) I want to say that if all animals of the same type have been chipped then they are ready to go home. (i.e. for each distinct value in column A, I want to evaluate whether all values in column B = "Yes", if so return "Yes" in column C)

 

In this case, one dog has not been chipped and so dog is not ready to go home. All cats have been chipped and so can be moved home.

 

AnimalChipped?Ready to go home?
DogYesNo
DogYesNo
DogNoNo
CatYesYes
CatYesYes

 

Thanks in advance

1 ACCEPTED SOLUTION
Uspace87
Resolver III
Resolver III

Ready go home = IF(COUNTROWS(FILTER('Table', 'Table'[Animal]= EARLIER('Table'[Animal]) && 'Table'[Chipped] = "Yes")) = COUNTROWS(FILTER('Table', 'Table'[Animal] = EARLIER('Table'[Animal]))), "Yes", "No")

View solution in original post

3 REPLIES 3
Uspace87
Resolver III
Resolver III

Ready go home = IF(COUNTROWS(FILTER('Table', 'Table'[Animal]= EARLIER('Table'[Animal]) && 'Table'[Chipped] = "Yes")) = COUNTROWS(FILTER('Table', 'Table'[Animal] = EARLIER('Table'[Animal]))), "Yes", "No")
cmck
Frequent Visitor

Thank you!!!

 

If I make a new table with the distinct animals in, is there a way I can tidy up the results and just have a single line with yes/no for each animal?

 

AnimalReady to go home
DogNo
CatYes

you can just plot it with animal and the ready to go home column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors