Forum Discussion

shikhar6339's avatar
shikhar6339
New Member
4 years ago
Solved

toss decision

Hi All,

 

I have the below data which I want to represent in a pie chart showing percent of team batting first won vs team bowling first won.

 

Please let me know if anything else is required.

 

Team 1Team 2Toss winnerToss decisionWinner
abcxyzabcbatxyz
xyzrstxyzbowlxyz
rstxyzxyzbowlxyz
abcxyzxyzbatabc
xyzabcabcbowlabc
abcrstrstbatrst
rstxyzrstbowlxyz
xyzabcabcbatxyz
abcxyzabcbowlabc
xyzrstxyzbowlrst
rstabcabcbatrst
abcrstabcbowlrst
rstabcrstbowlabc
abcrstrstbatrst
xyzabcxyzbowlxyz
rstxyzxyzbatxyz
abcrstrstbatrst
  • Hi shikhar6339 ,

     

    You cna create a column with below code:-

    Bat_or_bowl_first = if(Table_[Toss winner] = Table_[Winner] && Table_[Toss decision] = "bat",1,0)

    Now create these two measure:-

    _bat_first = COUNTROWS(FILTER(Table_,Table_[Bat_or_bowl_first] = 1))
    _bowl_first = COUNTROWS(FILTER(Table_,Table_[Bat_or_bowl_first] = 0))

     

    Output:-

     

    Thanks,

    Samarth

     

1 Reply

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi shikhar6339 ,

     

    You cna create a column with below code:-

    Bat_or_bowl_first = if(Table_[Toss winner] = Table_[Winner] && Table_[Toss decision] = "bat",1,0)

    Now create these two measure:-

    _bat_first = COUNTROWS(FILTER(Table_,Table_[Bat_or_bowl_first] = 1))
    _bowl_first = COUNTROWS(FILTER(Table_,Table_[Bat_or_bowl_first] = 0))

     

    Output:-

     

    Thanks,

    Samarth