Forum Discussion

Caitlin_Knox's avatar
Caitlin_Knox
Icon for Advocate III rankAdvocate III
10 years ago
Solved

% of Total

I've read through the other posts on this topic, but can't seem to apply it to my model.

 

In the same table, I have multiple Groups- each with their own code. I've created a calculated column that parses out the Check amount for that Group. I'd like to call this column into my %of total calculation so that I can get the % of total of a department against the Group total.

 

Here's what I have so far

% = DIVIDE(SUM(vw_ClientMovements[Check Amounts - S2458]),CALCULATE(SUM(vw_ClientMovements[Check Amounts - S2458]),ALLSELECTED(vw_ClientMovements[Expenses - S2458 - Bingo/Casino])))

 

[Check Amounts - S2458] is the calcluated column that only has CHK_AMOUNTs for Group S2458

[Expenses - S2458 - Bingo/Casino] is a calculated column that only returns CHK_AMOUNTs if 2 conditions are met- being part of Group S2458 and being in the department, "Bingo/Casino"

 

When I have %ofTotal as a calculated column, it just returns 1. When I have it as a measure, I get the error message "A single value for column 'CHK_AMOUNT' in table 'vw_ClientMovements' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

I have gotten this to work- I just think the above is a better way to do it.

Bingo/Casino % Total = [Sum of Expenses - S2458 - Bingo/Casino]/[Total w/out Fixed Cost - S2458]

7 Replies