cancel
Showing results for
Did you mean:  Helper V

## Total for a column

Hi everybody!

I need your help for this situation. I hava a table (TABLE1) like this:

 ID VALUE A1 200 A4 300 A5 50 A10 100

This table is related 1->* to another table (TABLE2), this one:

 ID NAME SURV A1 AAAA 1111 A1 AAAA 1111 A1 AAAA 1111 A1 AAAA 2222 A1 AAAA 2222 A1 AAAA 3333 A1 AAAA 4444 A2 BBBBB 5555 A2 BBBBB 5555 A2 BBBBB 6666 A3 CCCCC 7777 A3 CCCCC 8888 A3 CCCCC 8888 A4 DDDDD 9999 A4 DDDDD 9999 A4 DDDDD 9999 A4 DDDDD 9999 A4 DDDDD 10000 A4 DDDDD 10000 - - -

In this table, I have a measure called NumSurv = DISTINCTCOUNT(Table2[SURV]) that returns the number of answers to a questions. I show this model into a table visualization like this:

 Id Name NumSurv A1 AAAA 3 A4 DDDD 2 Total 5

This visualization have a filter for the Id (only shows A1 and A4, the Id that exists in the Table1)

I want a measure that returns the total of the NumSurv, in this case, 5. I created a new measure called TotalSurv but the result is not correct when I put it in the table visualization:

TotalSurv = CALCULATE([NumSurv],ALLSELECTED(Table2[Name]))

This is how it's show:

 Id Name NumSurv TotalSurv A1 AAAA 3 3 A4 DDDD 2 2 Total 5 5

And this I want it show:

 Id Name NumSurv TotalSurv A1 AAAA 3 5 A4 DDDD 2 5 Total 5 5

What is the formula for the measure TotalSurv?

Thnaks!!.

1 ACCEPTED SOLUTION  Helper V

I found the solution!

The measure is:

TotalSurv = CALCULATE([NumSurv],ALLSELECTED(Table2))

🙂  Helper V

I found the solution!

The measure is:

TotalSurv = CALCULATE([NumSurv],ALLSELECTED(Table2))

🙂   