Power BI Calculated Column Example

In this Power BI Tutorial, we will discuss how to add a calculated column in the PowerBI desktop. We will also see how to connect the SharePoint List to Power BI desktop.

Power BI Calculated Column

Calculated Column is a custom column that we can add manually in Power BI. In Power BI we can add the mathematical expression in a calculated column So that the new column will calculate the value by using the expression and the result will be applicable for all the rows.

From the below example we will see how to add the Calculated Column.

I have created a SharePoint List having below columns:

  • EmployeeName
  • PrincipelAmount
  • TimePeriod(Month)
  • RateOfIntrest
power bi calculated column

Open the Power BI desktop in the local system. Give the office 365 credentials if asked. Click on GetData -> More.

how to add calculated column in power bi
connect power bi to sharepoint online list

In the Get Data Page click on “Online Services” -> “SharePoint Online List”. Click on Connect.

power bi calculated column vs measure
power bi desktop connect to sharepoint online list

Pass the Site URL in the text box and click on OK.

how to create a calculated column in power bi
power bi report from sharepoint list

Select the List name in the Navigator page and click on Load.

how to add a new calculated column in power bi
power bi desktop connect to sharepoint online list

In the Data tab delete the unwanted column. To delete the column right-click on the column name you will get the delete option.

power bi online get data from sharepoint list
power bi online get data from sharepoint list

Add New Calculated Column in Power BI Desktop

Microsoft Power BI provides to add a new column in the Power BI desktop.

We can add custom Columns in two ways. One way is from the Data tab. Right, Click on the Column Name. Click on “New Column”.

power bi calculated column based on filter
power bi add column

Another one is from the Report tab. Right-click on any Column Name. We will get the “New column” option.

power bi calculated column group by
add column to power bi table

After adding the New Column I have added the rule like below:

SimpleIntrest = (EmployeeAccountDetails[PrincipelAmount]*EmployeeAccountDetails[TimePeriod(Month)]*EmployeeAccountDetails[RateOfIntrest])/100

Then automatically the rule will calculate the simple interest for all the row.

power bi calculated column based on measure
calculated column in power bi

For calculating the total amount I have added another table and add the rule:

Total Amount = EmployeeAccountDetails[PrincipelAmount]+EmployeeAccountDetails[SimpleIntrest]
Power Bi calculated column
PowerBi calculated column

In the Report tab, we will get the custom column name which we have created. I have added one Visualization from the Visualizations list. In the Axis and Value field, I have added the field name. One I have added “EmployeeName” and another one is “TotalAmount”.

calculated column in power bi
PowerBi calculated column

I have added one more table visualization and added all the column names.

calculated column in power bi
calculated column in power bi

You may like following Power BI tutorials:

We saw how to add the custom column and a calculated column in Power BI. How to add the rule in a custom column? We also saw how to display the custom column data in the Power BI visualization.

>