Forum Discussion

JonasBDM's avatar
JonasBDM
Regular Visitor
4 years ago
Solved

FORMULA COUNT WITH FILTER

Hi,

I hope you are well ! 

I have this tab : 

 

I would like to count the number of OFs that have only "KO" status. Can someone help me please ? 

Thank you in advance. 

Jonas BDM

 

 

  • What is the smallest "Phase" in KO Status ?

    Do you still want to calculate the number of OFs with only "KO" status?

    You can try to create a new column like below:

    Column = 
    var min_ = MINX(FILTER('Table',EARLIER('Table'[OF])='Table'[OF]),'Table'[Phase])
    return IF(min_='Table'[Phase]&&'Table'[STATUT]="KO",1)

     

5 Replies

    • JonasBDM's avatar
      JonasBDM
      Regular Visitor

      Thank for your help Tahreem24 

      Your measure works, but I would like to count the number of OF that have no "OK". In this example, the result would be 2 (OF002 and OF004). Do you have another idea ? 🙂 

      • Tahreem24's avatar
        Tahreem24
        Super User

        JonasBDM TRy this,

        MEASURE = CALCULATE(COUNT(Table[OF]),Table[STATUT]="KO" && NOT(Table[STATUT]="OK"))

         

  • JonasBDM's avatar
    JonasBDM
    Regular Visitor

    I'm sorry but it's not the expected result. I will try to reformulate my problem. 

    To simplify things I added a new column called "PHASE"

    In this table, I would like to answer this question :  How many "OF" have their smallest "Phase" in KO Status ?

     

    • V-lianl-msft's avatar
      V-lianl-msft
      Community Support

      What is the smallest "Phase" in KO Status ?

      Do you still want to calculate the number of OFs with only "KO" status?

      You can try to create a new column like below:

      Column = 
      var min_ = MINX(FILTER('Table',EARLIER('Table'[OF])='Table'[OF]),'Table'[Phase])
      return IF(min_='Table'[Phase]&&'Table'[STATUT]="KO",1)