Calculated columns in Power BI

We can add a calculated column to the table in Power BI. Calculated columns are computed during data loading and become part of the data model, while measures are calculated on-the-fly during data visualization based on the report's context.

Note: • In the Data pane, the calculated column has a table with a small sigma (Greek letter) as its icon.
• A measure has the icon of a calculator.
• Calculated columns are created by using the other columns of the table. Even a calculated column can reference another calculated column in the table.
• Calculated column formulas are evaluated by using row context.
• Calculated column formulas can reference columns from other tables, but they need to use the RELATED or RELATEDTABLE function.

Step 1: In the Power BI Desktop, to create a calculated column, go to the Data view, from the left side of the report canvas.

Select the table in which we want to create a calculated column, then from the Table tools menu, select New column from the Calculations group

Calculated columns in Power BI

Alternatively, right click on the table and from the context menu click on “New column”.

Calculated columns in Power BI

Alternatively, click on three dots (…) on the table in the Data pane on Report view, and then click on “New column”.

Calculated columns in Power BI

By default, a new calculated column is named Column. If we don’t rename it, new columns will be named Column 2, Column 3, and so on. We can rename the columns, in the formula bar, rename the column, and then type an equals (=) sign.

DAX

Sum of 10th and 12th Marks = 'Students Data'[10th_Marks] + 'Students Data'[12th_Marks]

The output of the above dax function is shown below:

Calculated columns in Power BI