Forum Discussion

Pan_Forex's avatar
Pan_Forex
Icon for Helper III rankHelper III
3 years ago
Solved

Winrate calculated by TRUE OF FALSE

Hello, I would like to count the winrate % for each player. I have a table with 2 columns [player] and [won]. The player column is text and won is TRUE/FALSE. 

  • WinRate = 
       VAR total = COUNTROWS('YourTable')
       VAR won = CALCULATE(
           COUNTROWS('YourTable'),
           YourTable[won] = TRUE()
       )
    
       RETURN DIVIDE(won, total)

2 Replies

  • lukiz84's avatar
    lukiz84
    Icon for Memorable Member rankMemorable Member
    WinRate = 
       VAR total = COUNTROWS('YourTable')
       VAR won = CALCULATE(
           COUNTROWS('YourTable'),
           YourTable[won] = TRUE()
       )
    
       RETURN DIVIDE(won, total)