Forum Discussion

tejapowerbi123's avatar
6 years ago
Solved

Count based on condition

Hi Community,

Please review below and provide your suggestion,

I want to count organization based on “Decision”, I have used below formula and it not showing right result.

Count =
COUNTX(

    FILTER ( 'Raw Data',' Raw Data '[Decision] = "Award" ),

    ''Raw Data''[organization])

Raw Data

Organization

Decision

ABC

Award

ABC

Award

ABC

Decline

XYZ

Award

 

Final Result

Organization

Decision

Count only based on Awarded

ABC

Award

2

XYZ

Award

1

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    HI tejapowerbi123 ,

     

    Create a Calculated Column

     

    Column = CALCULATE(COUNT(Table2[Decision]),FILTER( ALLEXCEPT(Table2,Table2[Organization]), Table2[Decision] = "Award"))

     

     

     

    Regards,
    Harsh Nathani

    Appreciate with a Kudos!! (Click the Thumbs Up Button)
    Did I answer your question? Mark my post as a solution!

     

13 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tejapowerbi123 

     

    I would use

     

    _Count = 

    CALCULATE(COUNTX('Raw Data'[organization]), ALLEXCEPT('Raw Data','Raw Data[Decision]))

    (OR)

    CALCULATE(COUNTROWS('Raw Data'),'Raw Data'[Decision]="Award")

     

    Did I resolve your issue? Mark my post as a solution!

     

    Appreciate your Kudos, Press the thumbs up button!!

     

    Regards,
    Pranit

    • tejapowerbi123's avatar
      tejapowerbi123
      Helper V

      Thank you so much Pranit, I have used your suggestion but result is still not right.

      Count only based on Awarded
      2411
      2411
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi tejapowerbi123 

       

      I believe what you are looking for is below:

       

      CALCULATE (
      COUNTROWS('Raw Data'),
      FILTER ( ALLEXCEPT('Raw Data','Raw Data'[Decision]),'Raw Data'[Decision]="Award")
      )

       

      Did I resolve your issue? Mark my post as a solution!

       

      Appreciate your Kudos, Press the thumbs up button!!

       

      Regards,
      Pranit