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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sureshcu
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
Anonymous
Not applicable

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

Hi Tamasys,

 

  your solution works. Thanks for your help.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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)) )

Hi Tamasys,

 

  your solution works. Thanks for your help.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.