MIP Logo

Calculating optimal inventory levels using Tableau

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

1.Introduction

Imagine you are a data analyst tasked by the store manager to monitor inventory levels. This would mean calculating the percentage of time inventory levels are either below the minimum level (under-stocked)which is a trigger to order more stock, and the percentage of time inventory levels is above the maximum level (over-stocked) which should be avoided as this can result in increased storage cost and reduced profits.

 

2. The solution

For this example, we can demonstrate how this can be done in tableau. The test data contains the date, value which is the current stock level, min which is the minimum stock level and max the maximum stock level as set by the company.

Next we create a calculated field to determine the percentage of time inventory levels are either over-stocked, under-stocked or at optimal stock levels.

Name the calculated field as above min max? and type the following:

IF [Value] > [Max] then ‘Over-Stock’
ELSEIF [Value] < [Min] then ‘Under-Stock’
else ‘Optimal stock level’
END

Drag the calculated field to columns, and also to the rows. Set the rows to be continuous and count the number of events to get the following chart.

Now we can create a simple dashboard to show the trend in the inventory level over time and also the percentage of time stock levels was either over-stocked, under-stocked or at optimal stock levels.

 

Share this post