web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Count with condition a...
Power Apps
Answered

Count with condition and not include duplicate

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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!

Categories:
  • PavanKumar Profile Picture
    479 on at

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

  • Verified answer
    PavanKumar Profile Picture
    479 on at

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks! It worked!

    I used 

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard