Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Success Rate (%) by category

Hello all!   I am struggling with what seems to be an easy task.   I have a table named "success" that looks like the one below. I have the Category and the Outcome, and I would like to calculate...
  • Greg_Deckler's avatar
    6 years ago

    Anonymous - Here is the column you asked for. PBIX is attached below sig. Table (19)

    Success Rate = 
        VAR __True = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && [Outcome]))
        VAR __False = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && NOT([Outcome])))
        VAR __Result = DIVIDE(__True,__True+__False,0)
    RETURN
        IF(ISBLANK(__Result),0,__Result)