Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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".
Please advise how I can rectify this. Thank you!
Solved! Go to Solution.
Hi,
Try this measure
=divide([your numerator],calculate(countrows('your table name'),'your table name'[Progress status]<>"Not relevant"))
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:
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:
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.
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:
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:
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.
@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.
Hi,
Try this measure
=divide([your numerator],calculate(countrows('your table name'),'your table name'[Progress status]<>"Not relevant"))
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.
Hi,
Share the link from where i can download your PBI file.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |