Forum Discussion
ADSL
Post Prodigy
4 years agoCalculate 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 measure/metric?
Thanks and Regards,
How about
Contribution2 % =var _total =CALCULATE(SUM('Order'[Amt No VAT]),ALLEXCEPT('Order','Order'[Province]))ReturnDIVIDE(SUM('Order'[Amt No VAT]), _total,0)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])ReturnDIVIDE(_clientTotal,_Total_By_Client,0)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.
15 Replies
- jgeddes
Super User
Does
Contribution % =
var _total =
CALCULATE(
SUM([Total Sales by Province]),
ALL('tableName')
)
Return
DIVIDE(
SUM([Total Sales by Province]),
_total,
0
)Get you the result you are looking for?
- Ashish_Mathur
Super User
Hi,
Please show the expected result very clearly.