If you’ve ever used BI tools like Apache Superset, Power BI, or Tableau, you’ve likely come across two fundamental concepts: Metrics and Dimensions.
They are the building blocks of almost every chart, dashboard, and report, but for beginners, they can feel confusing at first.
This post explains these concepts in the simplest way possible, with relatable examples.
1. What are Dimensions?
Dimensions are descriptive fields used to categorize or group data. Think of them as "How do you want to slice your data?".
Examples of Dimensions:
· user_name
· city
· product_category
· order_date
If your data is a library, dimensions are like:
· Genre (Fiction, History)
· Author
· Publication Date
They help you organize and filter information.
2. What are Metrics?
Metrics are numerical values that you measure, aggregate, or analyze. Think of them as "What do you want to measure?".
Examples of Metrics:
· SUM(final_amount)
· COUNT(order_id)
· AVG(order_value)
· MAX(revenue)
In the same library example, metrics are:
· Total books
· Average pages per book
· Total books borrowed
Metrics help you to quantify insights.
Following table summarizes the difference between Dimension and Metric.
|
Aspect |
Dimension |
Metric |
|
Type |
Categorical/Text/Date |
Numeric |
|
Purpose |
Grouping / Filtering |
Measurement / Aggregation |
|
Example |
city = Chennai |
SUM(sales) |
|
Role |
Slice the data |
Measure the data |
3. Real-World Example (E-commerce Dataset)
Let’s take a simple dataset:
|
user_name |
city |
order_date |
final_amount |
|
Aarav Sharma |
Mumbai |
2024-01-05 |
74999 |
|
Diya Patel |
Ahmedabad |
2024-01-07 |
16999 |
|
Arjun Singh |
Delhi |
2024-01-08 |
60999 |
Example 1: Total Sales by City
How much revenue comes from each city?
Dimension: city
Metric: SUM(final_amount)
Example 2: Number of Orders per User
Who are the most active customers?
Dimension: user_name
Metric: COUNT(order_id)
Example 3: Daily Revenue Trend
How is revenue changing over time?
Dimension: order_date
Metric: SUM(final_amount)
4. How BI Tools Use Them Together
In tools like Apache Superset:
· Dimensions: Go to X-axis or group by
· Metrics: Go to Y-axis or aggregation
Example: Bar Chart
· X-axis: city (Dimension)
· Y-axis: SUM(final_amount) (Metric)
Note
· Start simple: 1 metric + 1 dimension
· Add complexity gradually (more dimensions = more clutter)
· Use filters to narrow down dimensions
· For better UX, limit categories (Top N + Others)
In summary, Dimensions tell you "what", Where as Metrics tell you "how much"
Previous Next Home
No comments:
Post a Comment