2 Replies Latest reply on Apr 16, 2018 5:43 PM by Nathan Cheng

# Quartile & Medians Based on Counts

Hi all, I'm new to the Tableau community.

What is the best way to calculate quartiles and medians based on the attached counts?

Ideally, I'd like for Tableau to return just 3 numbers for each Group:

Group A: Q1 = \$3, Median = \$5, and Q3 = \$7

Group B: Q1 = \$3, Median = \$5, and Q3 = \$6

• ###### 1. Re: Quartile & Medians Based on Counts

Hi Nathan,

There is Percentile function that can help you in calculating upper and lower quartile beside median.

Create 3 calculated fields with following formulas

• PERCENTILE([Field],0.25)
• PERCENTILE([Field],0.5)
• PERCENTILE([Field],0.75)

Above created calculated fields can calculate quartiles at any granularity.

• ###### 2. Re: Quartile & Medians Based on Counts

Hi Jeevan,

I think this approach would work if I were calculating the quartiles based on the raw data. However, my data has already been pre-aggregated with the counts. Did you look at the attachment?