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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculated column based on unique text values in another column.

I have a column with two unique text values available. I would like to use this column to create a new calculated column which displays a rate based on the two unique text values

 

The table looks like this:

Name                 Win?

Person1               Win

Person1               Win

Person1               Lose

Person2               Lose

Person2               Win

 

I would like to create a new column so that I can display the data like this:

Name                  Win Rate

Person1                66%

Person2                50%

 

I've tried to use Calculated functions but continue to receive error messages such as "Cannot convert value 'Win' of type text to type True/False'. Thank you for any help!

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

Try this, where Table1 is the first table you show:

1. Place Table1[Name] in the rows of a matrix visual

2. Create this measure and place it in values of the matrix visual:

Win Rate =
DIVIDE (
    CALCULATE ( COUNT ( Table1[Win?] ), Table1[Win?] = "Win" ),
    COUNT ( Table1[Win?] )
)

 

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous 

Try this, where Table1 is the first table you show:

1. Place Table1[Name] in the rows of a matrix visual

2. Create this measure and place it in values of the matrix visual:

Win Rate =
DIVIDE (
    CALCULATE ( COUNT ( Table1[Win?] ), Table1[Win?] = "Win" ),
    COUNT ( Table1[Win?] )
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.