In this example, we will illustrate the use of functions through a simple example: Concat.
We will continue with the document created in our previous example, Creating a Simple Diagram:

Step 1: Insert the desired function
We will want to add the full name of the employee to the output. The field is not in the table, so we will need to create it somehow. Using the Functions group in the Home tab, select the All Functions > String > Concatenate function. This will insert an instance of the Concat function into the diagram. The function has two input string parameters on the left and one result parameter on the right, which is the output of the function.
Step 2: Edit the parameters
We will want the result to be of the form "<LAST_NAME>, <FIRST_NAME>", so we will need to concatenate 3 strings:
| • | FIRST_NAME |
| • | ", " |
| • | LAST_NAME |
However, the function only accepts 2 parameters, so we will need to add an additional parameter to the function. Right-click on the function and choose Add Parameter. You may choose to enter a name for the parameter, but it is not relevant. Just click OK in the dialog box. You can always rename a parameter by right clicking on its text and selecting Edit Parameter.
The diagram should look like this:

Step 3: Bind the data
First bind the first and last input parameter to the LAST_NAME and FIRST_NAME fields respectively, by dragging the mouse from the arrow next to the fields onto the parameters.
To add the ", " string constant, we must add a Constant function with the desired text. In the Functions group, click on Constant - a new diagram element should appear. Right click on the Constant element and select Edit Constant Function. Select the string result type and type in ", " (a comma and a space) in the Result Value field. Click OK. Now bind the output of the Constant function to the input of the Concat function.
Lastly, bind the result of the Concat function to the ns:Emp element and a new attribute will be created named attribute-name. Right click on it, select Properties and change its name to "FULL_NAME".
The final diagram should look like this:

Step 4: View the output
To view the output, go to the View tab and select Output View. You will see the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:emp first-name="John" last-name="Brown" full-name="John,Brown"/>
<ns:emp first-name="Mary" last-name="Jane" full-name="Mary,Jane"/>
<ns:emp first-name="Arthur" last-name="Clark" full-name="Arthur,Clark"/>
</ns:root>
Note: This sample can be found in ConcatenateSample.dax from Samples\Job Samples folder.