Forum Discussion

LD's avatar
LD
Frequent Visitor
6 years ago
Solved

Calculate % in a Col considering Condition

Dear All,   Please, I would like to calculate the % of value "Yes" in a colum respect the total of other data.   Es.     COL 1           Yes           No           No           No           ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi LD ,

     

     

    Try this measure

     

    Percent =
    var a = CALCULATE(Count('Table'[COL 1]), KEEPFILTERS('Table'[COL 1] = "YES"))
    var b = COUNTROWS(ALL('Table'))
    RETURN
    DIVIDE(a,b)
     
     
     

    Regards,
    Harsh Nathani

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