Data

```Type             Borough       ListPrice
RentalType1      Manhattan       \$5,000
RentalType2      Bronx           \$3,000
RentalType2      Brooklyn        \$3,000
SalesType2       Manhattan       \$900,000
SalesType1       Brooklyn        \$100,000
SalesType1       Bronx           \$500,000
SalesType2       Queens          \$800,000
SalesType2       Staten Island   \$400,000```

What I actually want.

I want to calculate the median of sales price and the median rental price for an apartment in NYC( each of the 5 boroughs, Brooklyn, Bronx Manhattan, Queens and Staten Island).

In Tableau the sales and and rentals are groups of ListPrice -- Variables ListPrice is NUMBER(decimal) Type (includes Sales & Rentals, Borough

Any help is appreciated

I tried creating a calculated field but I guess that somehow did not worked for me. Following is what I tried in the calculated :

```WINDOW_MEDIAN(SUM([ListPrice])-1, -1)

ERROR: WINDOW_MEDIAN is being called with (float, integer), did mean
(float,integer,integer)
```
Apr 12, 2018 in Tableau 6,713 views

First let me clarify things for you. Your table calculation takes 3 arguments: Expression, First row and last row of the partition and what you did that, in your formula you haven't given last row of the partition.

You must run the function for type in each Borough and then calculate for each Borough.

So this is how your formula should look like:

```WINDOW_MEDIAN(SUM(INT([List Price])),FIRST(),LAST())
```

Here calculation2 is median value

• 1,560 points

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

How can I sort date field in presence of another date field in Tableau?

Goal: Sort the new ship date in ...READ MORE

How to calculate the percent of records within a group in tableau?

You can click the measure SUM(Number of Records) and ...READ MORE

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

How can I download tableau workbook with its data from tableau server?

In essence, no. Since the workbook is ...READ MORE