Forum Discussion

ADSL's avatar
ADSL
Icon for Post Prodigy rankPost Prodigy
3 years ago
Solved

Calculate the Contribution % by Province

Hi BI Community Team,   I want to calculate the contribution % by province of total sales as the table below.   ==> Formula = Grand Total Sales / Total Sales by Province   Any suggestion of...
  • jgeddes's avatar
    jgeddes
    3 years ago

    How about

    Contribution2 % =
    var _total =
    CALCULATE(SUM('Order'[Amt No VAT]),ALLEXCEPT('Order','Order'[Province]))
    Return

    DIVIDE(SUM('Order'[Amt No VAT]), _total,
    0
    )

     

  • jgeddes's avatar
    jgeddes
    3 years ago

    Are you looking for this

    Contribution3 % =
    Var _Total_By_Client =
    CALCULATE(
        SUM('Order'[Amt No VAT]),
        ALL('Order'[Province])
    )
    Var _clientTotal =
    SUM('Order'[Amt No VAT])
    Return
    DIVIDE(
        _clientTotal,
        _Total_By_Client,
        0
    )
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    To your Table visual, drag Province and Client Name.  Write these measures

    Sales = sum(Data[Total Actual Sales])

    Total sales = calculate([Sales],all(Data[Province]))

    Contribution (%) = divide([Sales],[Total sales])

    Hope this helps.