In Microsoft Power BI, you can create a custom calculated measure (or numeric aggregate calculation) from existing columns. In this article, we show you how to create calculated measures in Power BI with example.
To demonstrate these Power BI calculated measures, we will use the data source that we created in the Connect Power BI to SQL Server article.
How to create calculated measures in Power BI
To create a calculated measure, click the New measure option under the Modeling tongue.
Click on Power BI New measure The tab opens the DAX formula bar with the name of the default measures, as shown below.
You can change the name of this calculated measure according to your needs. Let me change the name of the measure as Total Sale
For the purpose of demonstrating calculated measures in Power BI, we added the Internet Sales Amount, Fact Internet Sales Reseller Sales Amount, and Fact Reseller Sales tables. Unlike calculated columns, you must use the aggregate function to create a measure.
As you can see in the screenshot below, while typing, Power BI IntelliSense displays the suggestions.
Clicking the Enter key or any key creates a new Measure called TotalSale.
Let me add the calculated measure we created earlier to a table. See the Create Table Report article to understand the steps required to create a table.
Let me minimize the Fields and Display tab so you can focus on the values in the table.
You can also apply filters on these calculated measures. In the screenshot below, you can see that we selected some areas in our pie chart, and the same has been reflected in the table as well.