Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
shikhar6339
New Member

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
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
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:-

Samarth_18_0-1645457509205.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
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:-

Samarth_18_0-1645457509205.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.