Forum Discussion
Ratio Calculation
- 2 years ago
You don't need a data model for this but, if you have a model, still this formula will work. Here is the DAX measure that you can use:
Ratio = VAR _clientTotal = CALCULATE ( SUM ( MainTable[Amount] ), FILTER ( ALL ( MainTable ), MainTable[ClientID] = SELECTEDVALUE ( MainTable[ClientID] ) ) ) VAR _ratio = DIVIDE ( SUM ( MainTable[Amount] ), _clientTotal ) RETURN _ratioWell instead of SUM ( MainTable[Amount] ) you can create a simple measure like this and use it too:
Total Amount = SUM ( MainTable[Amount] )Here is the screenshot of the solution:
Hope this will resolve your issue.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
Hello Anonymous
It would be great if you could provide more clarity on this problem. What do you mean by "I have a table with one column for the amount"? Does this table have both "ClientID" and "SubAccount" columns as well? The reason behind asking this question is, that we need to the amount is present at the "ClientID" level or, at the "SubAccount" level.
Even better would be, if you provide a sample dataset (anonymized) along with a screenshot/data of the expected answer. That will help us understand the granularity of the data and thereby form the appropriate solution.
Best Regards,
Udit
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
- Anonymous2 years agoNot applicable
Thanks for taking a look and the question.
Yes the MainTable does hold all three columns. ClientID, SubAccount and Amount. Here's a sample of the data.ClientID SubAccount Amount 231RQ1 231RQ2B1 17785 231YHP 231YHET2 185966.1 231YHP 231YHET3 132062 - quantumudit2 years agoSuper User
You don't need a data model for this but, if you have a model, still this formula will work. Here is the DAX measure that you can use:
Ratio = VAR _clientTotal = CALCULATE ( SUM ( MainTable[Amount] ), FILTER ( ALL ( MainTable ), MainTable[ClientID] = SELECTEDVALUE ( MainTable[ClientID] ) ) ) VAR _ratio = DIVIDE ( SUM ( MainTable[Amount] ), _clientTotal ) RETURN _ratioWell instead of SUM ( MainTable[Amount] ) you can create a simple measure like this and use it too:
Total Amount = SUM ( MainTable[Amount] )Here is the screenshot of the solution:
Hope this will resolve your issue.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree