Forum Discussion

hasharma19's avatar
hasharma19
Helper II
3 years ago

Calculate True and False Output

Dear All,
I have an issue wherein i want to count the true and false value.
I had creted a measure which is giving me true and False output. It is giving True wherever the rating is compliant and false for others. Now i need the count of True and False.
Please help me incorporating the same.

 

12 Replies

  • pls tru this

    count of True = 
    VAR _tbl = 
        FILTER(ADDCOLUMNS(VALUES('table'[Site Reviewed]),"Flag", [_COM]),[Flag]=1)
    RETURN
    COUNTROWS(_tbl)
    ------
    count of False = 
    VAR _tbl = 
        FILTER(ADDCOLUMNS(VALUES('table'[Site Reviewed]),"Flag", [_COM]),[Flag]=0)
    RETURN
    COUNTROWS(_tbl)
  • Ahmedx -Thanks a ton for the DAX.
    However, ths issue still persist.

    The below table i have created with DAX:-

    Dist = CALCULATE(COUNTAX(SUMMARIZE('DG Audit Reports','DG Audit Reports'[Site Reviewed],"MaxT", COUNT('DG Audit Reports'[Year])), [MaxT]))
    The total supposed to have 42 instead it is giving 40.
    Similarly, the DAX you have shared also goving 40 count too.
    Can you please relook it. Thanks 

     

    • Ahmedx's avatar
      Ahmedx
      Super User

      You need to write another measure like this

      count of True Fixed = SUMX(VALUES('Date'[Year]),[count of True ])
      • hasharma19's avatar
        hasharma19
        Helper II

        Ahmedx -Thanks!

        What changes i should apply to this DAX-Dist = CALCULATE(COUNTAX(SUMMARIZE('DG Audit Reports','DG Audit Reports'[Site Reviewed],"MaxT"COUNT('DG Audit Reports'[Year])), [MaxT]))

        so that i can  get the total count of site reviewed is 42
        Or please suggest the DAX.
        I have 42 site but while applying this dax getting 40.