-
1. Re: Calculating an average based on a dimension
Jim DehnerMay 10, 2018 11:37 AM (in response to james.evans.10)
Hi
see the attached
this is going to sound a little awkward but here is the rational - you are trying to do 2 separate calculations on the same data dimension - and to do that you really need 2 data sets
I took your excel sheet and made as copy of it and called one Male and the Other Female
I brought them into Tableau and used Union to append them together
there is a dimension Table Name that is used to address each data separately
this calculation looks at the table name and the Gender dimension and breaks out the results into 2 groups
now just bring them to the viz with avg for the aggregation
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
-
gender average.twbx 39.2 KB
-
-
2. Re: Calculating an average based on a dimension
james.evans.10 May 10, 2018 11:53 AM (in response to Jim Dehner)I thought that might be a solution, what if I wanted to create two calculated fields called Male AVG and Female AVG. There's no way to do that without doing the union?
-
3. Re: Calculating an average based on a dimension
Jim DehnerMay 10, 2018 12:28 PM (in response to james.evans.10)
give it a try - see what happens
Jim
-
4. Re: Calculating an average based on a dimension
shahana.syed.0 May 10, 2018 1:34 PM (in response to james.evans.10)Please try this calculated field for the same data and mark helpful when resolved!
{ FIXED [Gender]:AVG([Result])}