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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
ADSL
Post Prodigy
Post Prodigy

Calculate the Contribution % by Province

Hi BI Community Team,

 

I want to calculate the contribution % by province of total sales as the table below.

 

2022-10-13_00-11-39.jpg

==> Formula = Grand Total Sales / Total Sales by Province

 

Any suggestion of measure/metric?

 

Thanks and Regards,

3 ACCEPTED SOLUTIONS

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_0-1665674175243.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Are you looking for this

jgeddes_0-1665676187119.png

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
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

15 REPLIES 15
jgeddes
Super User
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?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @jgeddes,

 

Sorry...I had missing the request information. Actually we have different client but direct service the same province so then we want to know the contribution % by province and eash client.

 

2022-10-13_10-00-29.jpg

 

Any suggestion of measure to calculate it?

 

Best Regards,

I am not completely understanding your desired outcome but here are a couple of measures that might work for you.

jgeddes_0-1665667213170.png

Contribution % =
var _total =
CALCULATE(
SUM([Total Actual Sales]),
ALL('table (9)')
)
Return
DIVIDE(
SUM([Total Actual Sales]),
_total,
0
)
 
inScope Contribution % =
var _inScope =
ISINSCOPE('Table (9)'[Client Name])
var _provinceCalc =
[Contribution %]
var _clientCalc =
DIVIDE(
    SUM('Table (9)'[Total Actual Sales]),
    CALCULATE(
        SUM('Table (9)'[Total Actual Sales]),
        ALLEXCEPT('Table (9)','Table (9)'[Province])
    ),
    0
)
Return
IF(
    _inScope,
    _clientCalc,
    _provinceCalc
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @jgeddes,

 

Yes, understand because one sales rep serivce for multiple clients then want to know the contribution by province and client as well.

 

Please kindly help to check and assist again as the screenshot below.

 

2022-10-13_21-09-48.png

Any suggestion?

jgeddes_0-1665670868178.png

 

Contribution2 % =
var _total =
CALCULATE(
SUM([Total Actual Sales]),
ALLEXCEPT('table (9)', 'Table (9)'[Client Name])
)
Return
DIVIDE(
SUM([Total Actual Sales]),
_total,
0
)
 
This should work for you.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @jgeddes ,

 

I am trying your measure suggestion, but it's not working as expectation. Please kindly assist to check the screenshot below.

 

I think it should be "Total Sales of client and each province" divide by "grand total"

 

2022-10-13_21-39-00.png

 

2022-10-13_21-42-34.png

 

You can check the sample data of my pbix file - https://drive.google.com/file/d/1maX8nwvhc2TIUUVML59cvCUnsPG20PeI/view?usp=sharing 

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_0-1665674175243.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @jgeddes ,

 

For example -- If we want to know the contribution of client name "Sprite" by province.

 

Any suggestion?

 

Thanks and Regards,

Are you looking for this

jgeddes_0-1665676187119.png

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
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @jgeddes ,

 

Thank you very much for your helpful measure.

 

Best Regards,

Hi,

Please show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

Please kindly help to check the screenshot below that doing the total sales by client vs. total sales by province & client.

 

2022-10-13_11-14-11.jpg

 

Thanks and Regards,

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @ADSL ,

 

Here I suggest you to try this measure.

Measure = 
VAR _Total_By_Client = CALCULATE(SUM('Table'[Total Actial Sales]),ALLEXCEPT('Table','Table'[Client Name]))
RETURN
DIVIDE(SUM('Table'[Total Actial Sales]),_Total_By_Client)

My Sample:

RicoZhou_1-1665654626923.png

Result is as below.

RicoZhou_0-1665654608830.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @Anonymous,

 

I am trying your measure suggestion, but it seem not working. Please kindly assist to check the screenshot below.

 

2022-10-13_17-29-52.png

You can go through the sample file pbix - https://drive.google.com/drive/folders/1e8V0wERSSO7ildCMiM8nOYei2b_91n9D?usp=sharing 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors