Forum Discussion
Top 2 Contribution % calculation
Hi,
I'm trying to calculate the TopN contribution % based on Customer, Branch or Type.
| Customer | Branch | Type | Actual | Budget |
| A | NY | Red | $50 | $120 |
| B | CA | Green | $250 | $300 |
| C | IL | Blue | $40 | $150 |
| A | NY | Blue | $80 | |
| C | IL | Red | $60 |
I was able to calculate the Top 2 Customers using :
But when I try to calculate the contribution % using :
- Anonymous2 years ago
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')))Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- fooddCommunity Champion
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-Forum/ba-p/963216
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/1447523/highlight/true#M607150
This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied. - Jihwan_KimSuper 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 #] ) ) ) - AnonymousNot 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')))Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.