# Tableau Dimensions vs Measures Features and Comparison

## Dimension vs Measures

In Tableau, when we are connecting to any dataset the data is automatically differentiated into two parts i.e., Dimension and Measure.

Tableau worksheet view:

## What are the Dimensions in Tableau?

The Dimension is an independent variable where it is just the attribute name. Tableau will treat any qualitative data or categorical information as ‘Dimensions’.

Example:
In this example I am going to show you how Dimensions are different than Measures:
Drag Region into the columns shelf and Sales into the Rows shelf.

You can see how the Sales values are now divided into different regions. So, I can analyze the overall regional sales in my data.

## What are the Measures in Tableau?

Measure is a field that is a dependent variable which means that its value is a function of one or more dimensions where the numerical data values are considered as measures in Tableau or quantitative information as a measure.

Example:
I will provide a good example of measure here: Drag [Sales] into the Rows shelf. You can see a big bar chart created in the workspace.

So, here [Sales] has the data values in numbers so tableau recognized that it is a measure.

See here, you will get a clear idea about the measures are treated as dependent variables as if you see in the bar chart it just displays the aggregate value but not the exact analysis as what are the broken values of sales for a particular context.

So, individual measure value without any context is meaningless. So, to make it meaningful, I need to add any other data value to make it useful in the analysis that means the measure is a dependent variable in tableau.

 Feature Dimensions Measures Definition Dimensions are Qualitative information or Data. Measures are Quantitative information or Data. Specification These are independent variables in Tableau. While measures are dependent variables. Examples These are just attribute names like region, category, department, date, etc. which we can’t aggregate. These are numerical values like sales, profit, quantity on which we can do aggregation. Columns or Rows shelves When dragged on columns or rows shelves create headers. When dragged on rows or columns, it will create axis. Data nature Dimensions are discrete fields which are individually separate. Measures are continuous in nature and wholly unbroken. Sort Dimensions can be sorted ascending or descending order. Measures can not be sorted in ascending or descending order. Filter Can filter individual elements. Can filter only by range. Level of Details Dimensions mostly bring a level of detail to view in tableau. Measures do aggregate to view. Hierarchy Hierarchy of the dimensions data can be created. A hierarchy of measures cannot be created. Color shelf Dimensions, when dragged in the color card, you will get different color for each value of the dimension. Measures, when dragged into the color card, then the color palate will be gradient.

## Cases when Tableau misclassifies the data:

There are some data fields that are numeric types, but they need to be treated at dimensions or information.

For example, if in dataset I have [Customer ID] field. Now customer IDs are always in number type. So, tableau will automatically place them into measures shelf as it finds IDs are numbers.

Consider a business case like ‘count of orders per customer’ where I need the number of orders for each customer ID. So here it will not make sense if I SUM or AVG on the customer ID field, but I need them in separate and distinct to plot on a chart. But when I am connecting to data freshly, the fields like customer ID, Order ID are classified as measures.

There would never be any value to add all customer IDs to find the total or average or any numerical transaction. So, these fields should be dimensions instead of measure.

One more such case in my mind is that when our dataset contains null values then some misclassification happens in Tableau.

Suppose when a field should be a measure but have its first entry as ‘Null’ then tableau finds this field as string type as qualitative information and put this field into the dimensions shelf instead of in measure shelf.

## How to overcome the above problem?

The good news is that I can classify these misclassified dimensions or measures just by right click on the field and click on ‘Convert to dimension’ or ‘Convert to measure’ or just by dragging and dropping the fields into dimensions or measures shelves of the data pane.

These classifications of measures and dimensions are very much useful at the starting of the data preparation. It will be easier for further data analysis and design visualizations in tableau.