diff --git a/ui/src/dashboards/constants/index.js b/ui/src/dashboards/constants/index.js
index <HASH>..<HASH> 100644
--- a/ui/src/dashboards/constants/index.js
+++ b/ui/src/dashboards/constants/index.js
@@ -26,23 +26,23 @@ export const NEW_DEFAULT_DASHBOARD_CELL = {
 }
 
 const getMostCommonValue = values => {
-  const distribution = {}
-  let max = 0
-  let result = 0
-
-  values.forEach(value => {
-    distribution[value] = (distribution[value] || 0) + 1
-    if (distribution[value] > max) {
-      max = distribution[value]
-      result = [value]
-      return
-    }
-    if (distribution[value] === max) {
-      result.push(value)
-    }
-  })
+  const results = values.reduce(
+    (acc, value) => {
+      const {distribution, mostCommonCount} = acc
+      distribution[value] = (distribution[value] || 0) + 1
+      if (distribution[value] > mostCommonCount) {
+        return {
+          distribution,
+          mostCommonCount: distribution[value],
+          mostCommonValue: value,
+        }
+      }
+      return acc
+    },
+    {distribution: {}, mostCommonCount: 0}
+  )
 
-  return result[0]
+  return results.mostCommonValue
 }
 
 export const generateNewDashboardCell = dashboard => {
Use Iris' improved approach for determine most common cell sizes