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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Lattelin
Frequent Visitor

Idea to model Win% vs Discount%

Hi everyone,

 

I have a table with two columuns. One of them has a "Discount %" column and the other one has an outcome of either "Closed Won" or "Closed Lost". It looks similiar to below. I want to make a report that tracks the win% vs the discount % and I was wondering if anyone had any recommendations on what type of graph or metric to use. Also, how would I start about doing this, would I have to do some type of statistical technique, make a measure, etc? Open to any ideas. Thanks. 🙂 

 

Discount Percent     Outcome

 

20%                        Closed Won

10%                        Closed Won

30%                        Closed Won 

15%                         Closed Lost. 

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Lattelin ,

 

If you just want to calculate the  percentage of the number of "Won"  and all rows, you could use the following formula to create a measure:

win% = 
var _t=ADDCOLUMNS('Table',"Type",SUBSTITUTE([Outcome],"Closed ",""))
RETURN COUNTX(FILTER(_t,[Type]="Won"),[Outcome]) / COUNTROWS('Table')

Then use a Card visual to display it:

win%.PNG

Or if you want to show the Discount% and Win% in visuals such as Stacked column chart, I suggest you enter a new table for X-axis:

create a new table for visuals.PNG

And then create a measure like this:

Measure = SWITCH(MAX('ForVisuals'[X-axis]),"Win%",[win%], "Discount%", SUM('Table'[Discount Percent]))

The final output is shown below:

Win% and Discount%.PNG

If these do not make any sense, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Best Regards,
Eyelyn 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

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @Lattelin ,

 

If you just want to calculate the  percentage of the number of "Won"  and all rows, you could use the following formula to create a measure:

win% = 
var _t=ADDCOLUMNS('Table',"Type",SUBSTITUTE([Outcome],"Closed ",""))
RETURN COUNTX(FILTER(_t,[Type]="Won"),[Outcome]) / COUNTROWS('Table')

Then use a Card visual to display it:

win%.PNG

Or if you want to show the Discount% and Win% in visuals such as Stacked column chart, I suggest you enter a new table for X-axis:

create a new table for visuals.PNG

And then create a measure like this:

Measure = SWITCH(MAX('ForVisuals'[X-axis]),"Win%",[win%], "Discount%", SUM('Table'[Discount Percent]))

The final output is shown below:

Win% and Discount%.PNG

If these do not make any sense, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

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

Helpful resources

Announcements
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.