Forum Discussion
Formula to create win%
- Anonymous2 years ago
Hi Poornima2023 ,
Please try to create a measure with below dax formula:
Win% = VAR tmp = FILTER ( ALL ( 'Table' ), 'Table'[Status] = "Won" ) VAR tmp1 = FILTER ( ALL ( 'Table' ), 'Table'[Status] IN { "Lost", "Won" } ) VAR _a = SUMX ( tmp, [Value] ) VAR _b = SUMX ( tmp1, [Value] ) RETURN FORMAT ( DIVIDE ( _a, _b ), "Percent" )For more details, please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try this:
Win percentage = divide(sum(loss[loss table]),sum(win[win table]))
That is not formatted properly, but that should work.
Best,
Cam
- chonchar2 years agoHelper V
Notes on the divide function:
-DAX has a safeguard for DIV/0
-You must aggregate the total first, and then divide
-There is a potential for a 3rd argument after the 2 parentheses, which is basically the end of an “IF” function in Excel, which means if you get null or 0, the last argument will return whatever you want it to be.