cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Count with condition and not include duplicate

Hi guys!

 

How can we Count with some conditions but exclude doublicates?

For example: a Table like this:

No.   Name   Status

1       AAA      YES

2       BBB       NO

3       CCC      YES

4       AAA      NO

5       AAA      YES

6       AAA      NO

7       AAA      YES

8       DDD      NO

 

How can I have a formula to:

       return 2 with status = YES (for AAA and CCC);

       return 3 with status = NO (for BBB, AAA, DDD);

Thanks in advanced!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: Count with condition and not include duplicate

Hi,

 

You don't have to push the list to collection, You can directly use the collection in the formulae and add as many conditions as you would like.

 

Mark answer as verified if it answers your question.

Regards,

Pavan Kumar Garlapati

View solution in original post

4 REPLIES 4
Highlighted
Responsive Resident
Responsive Resident

Re: Count with condition and not include duplicate

Hi Trung,

 

You can use below formulae to get values avoiding duplicates. Lets say your actual list (which you have mentioned below) is in List Status Collection.

 

ClearCollect(StatusCollection,
{ Name: "AAA", Status: "YES"},
{ Name: "BBB", Status: "NO"},
{ Name: "CCC", Status: "YES"},
{ Name: "AAA", Status: "NO"},
{ Name: "AAA", Status: "YES"},
{ Name: "AAA", Status: "NO"},
{ Name: "AAA", Status: "YES"},
{ Name: "DDD", Status: "NO"}
);

 

//List which gets Unique Yes Names

ClearCollect(DistinctYesStatus, Distinct(Filter(StatusCollection, Status ="YES"),Name));

 

//List which gets Unique No Names.

ClearCollect(DistinctNOStatus, Distinct(Filter(StatusCollection, Status ="NO"),Name));

 

Mark it as verified if it answers your problem.

Regards,

Pavan Kumar Garlapati

Highlighted
Anonymous
Not applicable

Re: Count with condition and not include duplicate

Thank @PavanKumar;

My list is in Excel and the conditions are complicated (many conditions).

I am looking for a solution without push the list to a Collection.

Highlighted
Responsive Resident
Responsive Resident

Re: Count with condition and not include duplicate

Hi,

 

You don't have to push the list to collection, You can directly use the collection in the formulae and add as many conditions as you would like.

 

Mark answer as verified if it answers your question.

Regards,

Pavan Kumar Garlapati

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Count with condition and not include duplicate

Thanks! It worked!

I used 

CountRows(Distinct(Filter(Table;Conditions1...));Name))

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,022)