Forum Discussion
Adding a calculated colum with different aggregated level
- 1 year ago
figured this out... I am just using wrong table in allexcept... thanks all for the help!
I have Clientname column (dimclienttable), mainaccount column (dimclienttable) and estimatedcommssion column (policytable).dimclienttable and policytable have one-many relationship. I want to add a column in policytable calculated as estimatedcommission at mainaccount level not at client level(one mainaccount has multiple clientnames and the
mainaccount can be client by itself). date is shown below.
| ClientName | MainAccount | IsMain | Sum of EstimatedCommission |
| 10 Federal Holdings LLC | 10 Federal Holdings LLC | TRUE | $94,163 |
| MV at Boone LLC | 10 Federal Holdings LLC | FALSE | $50,769 |
| Davinci Lock Self Storage, Inc. | 10 Federal Holdings LLC | FALSE | $939 |
| Bowman RD 1, LLC | 10 Federal Holdings LLC | FALSE | $109 |
| 10 Federal Finance LLC | 10 Federal Holdings LLC | FALSE | $0 |
| 10 Federal Sitework LLC | 10 Federal Holdings LLC | FALSE | $0 |
| 10FSS 1453 Fernwood Glendale Rd Spartan | 10 Federal Holdings LLC | FALSE | $0 |
| 10FSS 2601 Industrial Dr. | 10 Federal Holdings LLC | FALSE | $0 |
$145,980
|
But what is want is an extra column where sumofestimatedcommission summed up to mainaccount level as below:
| ClientName | MainAccount | IsMain | Sum of EstimatedCommission | Sum of TotalEstimatedCommissionByMainAccount |
| 10 Federal Holdings LLC | 10 Federal Holdings LLC | TRUE | $94,163 | $145,980 |
| MV at Boone LLC | 10 Federal Holdings LLC | FALSE | $50,769 | $145,980 |
| Davinci Lock Self Storage, Inc. | 10 Federal Holdings LLC | FALSE | $939 | $145,980 |
| Bowman RD 1, LLC | 10 Federal Holdings LLC | FALSE | $109 | $145,980 |
| 10 Federal Finance LLC | 10 Federal Holdings LLC | FALSE | $0 | $145,980 |
| 10 Federal Sitework LLC | 10 Federal Holdings LLC | FALSE | $0 | $145,980 |
| 10FSS 1453 Fernwood Glendale Rd Spartan | 10 Federal Holdings LLC | FALSE | $0 | $145,980 |
| 10FSS 2601 Industrial Dr. | 10 Federal Holdings LLC | FALSE | $0 | $145,980 |
I am using the below formula:
| ClientName | MainAccount | IsMain | Sum of EstimatedCommission | Sum of TotalEstimatedCommissionByMainAccount |
| 10 Federal Holdings LLC | 10 Federal Holdings LLC | TRUE | $94,163 | $94,163.30 |
| MV at Boone LLC | 10 Federal Holdings LLC | FALSE | $50,769 | $50,769.30 |
| Davinci Lock Self Storage, Inc. | 10 Federal Holdings LLC | FALSE | $939 | $939.45 |
| Bowman RD 1, LLC | 10 Federal Holdings LLC | FALSE | $109 | $108.75 |
| 10 Federal Finance LLC | 10 Federal Holdings LLC | FALSE | $0 | $0 |
| 10 Federal Sitework LLC | 10 Federal Holdings LLC | FALSE | $0 | $0 |
| 10FSS 1453 Fernwood Glendale Rd Spartan | 10 Federal Holdings LLC | FALSE | $0 | $0 |
| 10FSS 2601 Industrial Dr. | 10 Federal Holdings LLC | FALSE | $0 | $0 |
Please help!
you can try this
=calculate(sum(EstimatedCommission),allexcept(table, MainAccount))
- jostnachs1 year agoHelper IV
Hi, Thanks for the suggestion. I tried the formula and still gives me same values. I dont know what i am doing wrong.
- jostnachs1 year agoHelper IVthis works as a measure.... but i want it as a calculated column.
- jostnachs1 year agoHelper IV
figured this out... I am just using wrong table in allexcept... thanks all for the help!