Introduction

Power BI comes with the powerful formula language Data Analysis Expression (DAX) which allows the implementation of custom calculations. There are numerous operators and functions available in DAX. One important DAX function is the CONCATENATE function. With the CONCATENATE function, two text values can be merged into one text value. Specifically, this function facilitates the merging of two columns into one. In this tutorial, we will explore the CONCATENATE function and show you how to use it.

Data

The data for this tutorial comes from an Excel file. In the following tutorial, we explain how to import data from an Excel file into Power BI:

Power BI - Import Data from Excel file
Introduction In this tutorial, we want to import Data from a Excel file into Power BI. This can be easily done in the Power BI Desktop interface. Data Source Our data source is the Excel file student. The file contains the following data: Power BI Desktop In the following, we

We have loaded the data into Power BI without executing any transformations. The data looks as follows:

Now, let's explore how the DAX function CONCATENATE works and how to use it.

Syntax

The syntax of the CONCATENATE function looks as follows:

CONCATENATE(<text1>, <text2>)

Let's look at the components in detail:

<text1> First text string to be concatenated. The text string can be a text, a number or a column reference.
<text2> Second text string to be concatenated. The text string can be a string, a number or a column reference.

Example 1: Concatenate two Columns

Now, let's perform an example calculation with the CONCATENATE function. In our example, we want to concatenate the columns "name" and "studentid".

First, we create a new calculated column.

We name the calculated column "Name and StudentID" and enter the DAX code.

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In