Power BI: Create Table from Another Table by Using DAX


You can use the following syntax in DAX to create a table from another existing table in Power BI:

New_Data = SELECTCOLUMNS(
    My_Data,
    "Team", [Team],
    "Points", [Points])

This particular example creates a new table named New_Data that contains the columns named “Team” and “Points” from the existing table named My_Data.

The following example shows how to use this syntax in practice.

Example: How to Create Table from Another Table Using DAX

Suppose we have the following existing table in Power BI named my_data:

Suppose that we would like to create a new table that contains just the Team and Points columns from the My_Data table.

To do so, click the Table Tools tab, then click the New table icon:

Next, type the following formula into the formula bar:

New_Data = SELECTCOLUMNS(
    My_Data,
    "Team", [Team],
    "Points", [Points])

Once you press Enter, a table named New_Data will be created that contains only the Team and Points columns from the existing table named My_Data:

Note that you can also specify new column names to use in the new table if you’d like.

For example, we could use the following syntax to rename the columns Team_Name and Points_Scored:

New_Data = SELECTCOLUMNS(
    My_Data,
    "Team_Name", [Team],
    "Points_Scored", [Points])

This will create the following table with the column names that we specified:

Note: You can find the complete documentation for the SELECTCOLUMNS function in DAX here.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

How to Count Number of Occurrences in Power BI
How to Write an IF Statement in Power BI
How to Write an IF Statement with Multiple Conditions in Power BI

Leave a Reply

Your email address will not be published. Required fields are marked *