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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
TB2
New Member

Top 2 Contribution % calculation

Hi, 

 

I'm trying to calculate the TopN contribution % based on Customer, Branch or Type.

 

CustomerBranchTypeActualBudget
ANYRed$50$120
BCAGreen$250$300
CILBlue$40$150
ANYBlue$80 
CILRed$60 

 

I was able to calculate the Top 2 Customers using :

Top 2 Customers = VAR Top2 = TOPN(2, ALL('Customers'[Customer #]), [Sales Revenue],DESC) RETURN CALCULATE([Sales Revenue], FILTER('Customers', 'Customers'[Customer #] IN Top2))

 

But when I try to calculate the contribution % using :

Top 2 Contribution % = DIVIDE('_Calculations'[Top 2 Customers],'_Calculations'[Sales Revenue])
 
It returns 100% each time I select a customer, branch or type instead of the sales revenue as a percentage of the total revenue.
 
 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @TB2 ,

Thank you @Jihwan_Kim very much for the solution, and I've tried other ways to help you understand the problem:

For your question, I think your last step could include an all condition to remove the context filtering.

TOP 2 Contribution % = DIVIDE('Table'[Top 2 Customers],CALCULATE('Table'[sales revenge],ALL('Table')))

vxingshenmsft_0-1720422422052.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

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

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @TB2 ,

Thank you @Jihwan_Kim very much for the solution, and I've tried other ways to help you understand the problem:

For your question, I think your last step could include an all condition to remove the context filtering.

TOP 2 Contribution % = DIVIDE('Table'[Top 2 Customers],CALCULATE('Table'[sales revenge],ALL('Table')))

vxingshenmsft_0-1720422422052.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

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

 

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try something like below whether it suits your inquiry.

 

Top 2 Contribution % =
DIVIDE (
    [Top 2 Customers],
    CALCULATE ( [Sales Revenue], ALLSELECTED ( 'Customers'[Customer #] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
foodd
Super User
Super User

Hello @TB2 , and thank you for sharing your question with the Community.  Please remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).  You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share the file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.