Forum Discussion

watje255_ju's avatar
watje255_ju
Icon for Helper III rankHelper III
4 years ago
Solved

Discount Allocation

Hello,    I want to calculate the sales revenue generate from each product, but the total discount is a line item. Does anyone know how I could allocate the total discount to each item? The discoun...
  • Avantika-Thakur's avatar
    4 years ago

    Hi watje255_ju ,

    You can try using the below measure for Discount calculation - 

     

    Discount =
    VAR DiscountAmount = calculate ([Sales Amount],
    ALLEXCEPT(Discount,Discount[Sales Order Number]),Discount[Product Code]= "Discount" )

    VAR SalesAmount = calculate ([Sales Amount], ALLEXCEPT(Discount,Discount[Sales Order Number]),Discount[Product Code]<> "Discount" )

    Return DIVIDE(discountAmount,SalesAmount,0)

     

    Hope this helps!
     
    Please accept the solution if this answers your query.
    Thanks!
    Avantika