What is the reason behind Microsoft using both "column" and "measure" in PowerBI Desktop reports

 Columns and measures are two important concepts of Power BI. Understanding the key differences between Columns and Measures will not only help you make better decisions but also improve your Power BI model performance. Here we will check the difference between the calculated column and the measure in Power BI.

In Power BI Desktop, both columns and measures are used to perform calculations but they serve different purposes and are used in different contexts.

Calculated Columns

  • Static Values: Calculated columns are computed during the data loading phase and their values are stored in the data model.
  • Row-by-Row Calculation: They are calculated for each row in a table, similar to how you might use formulas in Excel.

Usage: Useful for row-level calculations and can be used in tables, charts, slicers etc.

Example: If you have a sales table, you might create a calculated column to compute the total cost for each row. A Calculated Column is a column that you add to an existing table in the data model in Power BI. Write here the DAX (Data Analysis Expression) expression:

Total Cost = Sales[Price] * Sales[Quantity]

In Power BI, it looks like this:

For Total Cost, you have to create a New Column

The overall expression is that

Measures

Dynamic Values: Measures are calculated on the fly, based on the context of the report or visual.

Aggregate Calculation: They are used for calculations that need to be aggregated such as sums, averages or other totals.

Usage: Mainly used in visuals, pivot tables and pivot charts.

Example: To calculate the total revenue, you might create a measure.

It’s computed during the data loading phase and the values are stored in the Power BI model. The formula for a Calculated Column is calculated for each row in a table.

Total Revenue = SUM(Sales[Total Cost])

If you add in the Power BI, you will see like this:

Key Differences

Calculation Time: Calculated columns are computed during data loading while measures are computed at query time.

Storage: Calculated columns are stored in the data model whereas measures are not stored and are computed dynamically.

Performance Impact: Calculated columns can increase the model size while measures have minimal impact on model size.

When to Use Each

Use Calculated Columns: When you need row-level calculations that are static and stored in the model.

Use Measures: When you need dynamic calculations that change based on the filter context of your visuals.

Understanding these differences helps you improve your Power BI reports. If still any query, pls ask without any hesitation.

Comments

Popular posts from this blog

TDS on Salary – Entry in Tally

Post Dated Cheque (PDC) Management

Personal Accounts in Tally