KNOWLEDGE BASE

Calculating the Mode of Distribution


Published: 26 Aug 2013
Last Modified Date: 18 Jul 2017

Issue

How to calculate the mode of a distribution.

Environment

Tableau Desktop

Resolution

The following instructions can be reviewed in the workbook attached below.

Create a calculated field with the following formula, where y is the desired measure on the y axis, and x is the desired dimension on the x axis::
WINDOW_MAX(IIF(SUM(y)==WINDOW_MAX(SUM(y)),ATTR(x),0))

Note: The above formula relies on very specific table calculation settings. As an alternative, place the desired measure on Detail as a discrete dimension, then place the following calculated field on Filters, computed using the desired measure:

SUM([Number of Records])=WINDOW_MAX(SUM([Number of Records]))
Did this article resolve the issue?