4 Replies Latest reply on Feb 7, 2019 7:18 PM by fikri.shihab

# How to calculate mode

Hi tableau experts, I ma trying calculate mode for each of region from my data sets and read the example from this link https://community.tableau.com/external-link.jspa?url=http%3A%2F%2Fwww.tableausoftware.com%2Fvideos%2Fmeans-modes-percentiles-outliers but still unable to figure out how to do that with my data set. My data set has filed called region, location, value.  each location has hundreds or thousands of values and I have  made frequency distribution for selected locations using number of records and created bins for this location in order to see where the most frequent bin (range of values) occur in the chart. What I'd like to do is simply to create a table that contains a list of locations and each of location just show the mode value for each location. Note the the mode in this case is the highest occurrence of  bin for each location. The out is a simple table with 3 columns (Region, location, mode) and several rows.  Please suggest how this can be done?

The attached is a sample file with simply random numbers.

Message was edited by: Fikri Shihab

• ###### 1. Re: How to calculate mode

Like This?

Thanks

Deepak

If It Helps, Pl Mark it Helpful and CORRECT to Close Thread

• ###### 2. Re: How to calculate mode

Hi Deepak, Thanks for looking into this. I think it is getting closer now. What I was looking for was not the frequency of the occurrence itself, but what bin most frequently occurs. So I would expect the second column would show something like 520, 540, 600, etc. for each row, based on what bin value most frequently occurs. Regards, Fikri

• ###### 3. Re: How to calculate mode

Hi, Fikri

Please find my solution below

One thing is, there are some bins with the same frequency, this solution will shown them all.

Hope this helps

ZZ

• ###### 4. Re: How to calculate mode

Hi Zhouyi, Thank you for the solution. This is helpful! This is exactly what I was looking for. -Fikri

1 of 1 people found this helpful