Power BI – DAX Calculated Columns

Add a new column to your table using the concept of calculating columns. Calculated columns calculate results by using DAX. Let us load an Excel file with the profit records based on year and month.

Input File: Region.xlsx
Ouptut Saved as: AMIT DAX Calculate Columns.pbix

Click Get data and then Excel Workbook or directly click Excel Workbook. Select your Excel file Region.xlsx and click Open:

Get data from excel with Power BI

We have our Region.xlsx now. Load it now. After loading the following two columns are visible in the Location table:

Get data from excel with Power BI

To add a new column, right-click on the table and click New column. Calculate columns are created and displayed in Report ViewData View, or Model View by using this New column feature:

Add a new column to a table in Power BI

Now, the formulae bar is visible. Add the DAX expression to set both the city and state together:

Set the DAX Expression for the columns in Power BI

We created a new column and a symbol is also visible:

New column created successfully with DAX in Power BI

Above the Column text in the formulae can be replaced with whatever name you want for the new column. We can also rename it later as shown below. Right-click the new column and click Rename:

Rename the new column name in Power BI

We renamed it successfully. For example, we renamed it CityState. You can give any name.

We selected the column and clicked the Table under the Visualizations pane. Now, our column is visible with the City as well as State names:

New column created with DAX is visible on the table canvas as well in Power BI

Note: We also formatted the above table using the Format your visual under the Visualizations pane. For the bold header, we selected the style. To increase the font size, we clicked the Values as shown below:

Format the newly created table with Power BI

Press CTRL+S and save it:

Save the Power BI DAX Calculated Columns file in Power BI


 

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Power BI - DAX Calculated Tables
Power BI - DAX Measures
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading