cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Apply Discount to Total

Hi,

 

I am trying to get Final Value after deducting discount. I have written the followig measure which is not working. Can anyone correct it

 

Discount Apply = SUMX(Orders,Orders[Sales]*Orders[Quantity]-Orders[Discount])

 

Discount column is number. need to apply %.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Frequent Visitor

Re: Apply Discount to Total

Can you clarify, do you mean that the discount column is a number representing a percentage from 1 to 100?

 

If so, you'll need to convert this to a number between 0 and 1 - 0 being 0%, 1 being 100%. To do that, just divide by 100. For a discount of 26%, do [Discount]/100 e.g. 26 / 100 = 0.26

 

There are a couple ways of getting the discounted amount now, but I'd just flip the discount percent around to get the discounted percentage with 1-[Discount Percent] e.g. 1 - 0.26 = 0.74

 

Now we can just multiply the sale by the discounted percent to get the discounted cost: [Sales] * [Quantity] * [Discount Percent]

e.g. $5 * 12 = $60, so $60 * 0.74 = $44.40

 

So you can do it in steps, or do it all in the one measure, where the final thing should look something like 

Discount Apply = SUMX(Orders,Orders[Sales]*Orders[Quantity] * (1-(Order[Discount]/100)) )

View solution in original post

Highlighted
Helper I
Helper I

Re: Apply Discount to Total

Hi Tamasys,

 

  your solution works. Thanks for your help.

View solution in original post

2 REPLIES 2
Highlighted
Frequent Visitor

Re: Apply Discount to Total

Can you clarify, do you mean that the discount column is a number representing a percentage from 1 to 100?

 

If so, you'll need to convert this to a number between 0 and 1 - 0 being 0%, 1 being 100%. To do that, just divide by 100. For a discount of 26%, do [Discount]/100 e.g. 26 / 100 = 0.26

 

There are a couple ways of getting the discounted amount now, but I'd just flip the discount percent around to get the discounted percentage with 1-[Discount Percent] e.g. 1 - 0.26 = 0.74

 

Now we can just multiply the sale by the discounted percent to get the discounted cost: [Sales] * [Quantity] * [Discount Percent]

e.g. $5 * 12 = $60, so $60 * 0.74 = $44.40

 

So you can do it in steps, or do it all in the one measure, where the final thing should look something like 

Discount Apply = SUMX(Orders,Orders[Sales]*Orders[Quantity] * (1-(Order[Discount]/100)) )

View solution in original post

Highlighted
Helper I
Helper I

Re: Apply Discount to Total

Hi Tamasys,

 

  your solution works. Thanks for your help.

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors