
1. Re: Calculating Mean/Median using a subset of data
Jim Dehner Sep 18, 2018 2:06 PM (in response to Anthony Sardain)hi try this
add the week to context  the context filter will apply before the lod statement
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.

TableauQuestion4_v10.2.twbx 43.8 KB


2. Re: Calculating Mean/Median using a subset of data
Anthony Sardain Sep 18, 2018 2:15 PM (in response to Jim Dehner)Hi Jim,
Doing this changes the top value in each cell. I'm trying to compare the mean and median fatalities across weeks 126 (bottom two values) against the number of fatalities in week 52 (top value) – therefore changing the context filter here would change the top value.

3. Re: Calculating Mean/Median using a subset of data
Jim Dehner Sep 18, 2018 2:40 PM (in response to Anthony Sardain)try this
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.

TableauQuestion4.twbx 43.1 KB


4. Re: Calculating Mean/Median using a subset of data
Anthony Sardain Sep 18, 2018 3:09 PM (in response to Jim Dehner)Hi Jim,
This seems like a partially right answer, although the numbers as included here don't make sense.
For Afghanistan, the cell values (when cutting of at Week 24) should be 22.22, 26.02, and 7, not 822,735.4, and 524.
Using what you sent, I fixed the first two values by changing the aggregation from SUM() to AVG() in the first two cases, but can't seem to get the right median value.