Calculated columns in Power BI
In this exercise we will learn how to add a calculated column to the table in Power BI.
We can write a DAX formula to add a calculated column to any table in our model. The formula is evaluated for each table row, and it returns a single value. 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.
When added to an Import storage mode table, the formula is evaluated when the data model is refreshed, so it can increase the data refresh time, and it increases the storage size of our model. The reason is because calculated columns recalculate when they have formula dependencies to refreshed tables. When added to a DirectQuery storage mode table, the formula is evaluated by the underlying source database when the table is queried.
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.
Step 2: 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

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

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

Step 3: 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
The output of the above dax function is shown below:

Note: We can double click on the column name to change the name of the column in the Power BI.