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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

I am trying to create a calculated column to calculate the Win Rate % but it's not working

In my column "Progress Status", I have 4 unique values: Won, Lost, Pending and Not Relevant.

 

I am trying to calculate the Win Rate % by taking the number of "Won" divided by the number of "Won + Lost + Pending".

 

agatheeben_0-1620961040164.png

Please advise how I can rectify this. Thank you!

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=divide([your numerator],calculate(countrows('your table name'),'your table name'[Progress status]<>"Not relevant"))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description and DAX formula, I think you should use the “In” operator to replace “=” to make the measure work to meet your requirement, you can try this measure:

This is my test data based on your DAX formula:

v-robertq-msft_0-1621239976152.png

 

Win Rate % =

var _win=COUNTROWS(FILTER(ALL('Table'),[Progress Status]="Won"))

var _total=COUNTROWS(FILTER(ALL('Table'),[Progress Status] in {"Won","Lost","Pending"}))

return

DIVIDE(_win,_total)

Then create a card chart to place this measure:

v-robertq-msft_1-1621239976155.png

 

And you can get what you want.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description and DAX formula, I think you should use the “In” operator to replace “=” to make the measure work to meet your requirement, you can try this measure:

This is my test data based on your DAX formula:

v-robertq-msft_0-1621239976152.png

 

Win Rate % =

var _win=COUNTROWS(FILTER(ALL('Table'),[Progress Status]="Won"))

var _total=COUNTROWS(FILTER(ALL('Table'),[Progress Status] in {"Won","Lost","Pending"}))

return

DIVIDE(_win,_total)

Then create a card chart to place this measure:

v-robertq-msft_1-1621239976155.png

 

And you can get what you want.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-robertq-msft  Hi Robert, thanks for your reply. I have solved this issue. But I have another issue that is related to this one which I am still having trouble with. 

Would appreciate if you could take a look at it as well:  https://community.powerbi.com/t5/Desktop/Confused-about-how-my-calculated-measure-value-changes-afte...

 

Thanks.

Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=divide([your numerator],calculate(countrows('your table name'),'your table name'[Progress status]<>"Not relevant"))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks for your reply Ashish, but I am still having an issue. The correct values that I am supposed to get are the percentages in the bar chart, but the values I am getting from the calculated measure is what you can see in the table below the bar chart. The values produced from the calculated measures are still incorrect. I have been stuck with this problem for a very long time. 

agatheeben_0-1620962361349.png

 

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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