Home » Power BI » Creating a Table in Power BI

Creating a Table in Power BI

Create a table into Power BI

In this blog you will understand different-different ways to create a table in Power BI or Enter data into Power BI.

Way-1: Creating a new Table by typing or Pasting

Power BI Desktop allows you to create a new table by manual typing, or copy and paste data from excel into Power BI.

Create Table by Typing

Go to Home table > Click on Table icon.

Create a Table Power BI

Create a Table Power BI




After that create Table window appears, here you can enter data by typing. After that click on Load button.

Create table by typing in Power BI

Create table by typing in Power BI

Create Table by Pasting

Copy data from Excel and Paste data into Power BI Table. After that assign the name to table and click on Load button.

Copy and Paste data from excel into Power BI

Copy and Paste data from excel into Power BI



Way-2: Creating a Table in Power BI by using DAX Table Constructor

Step-1: Go to Modeling Tab > click on Table icon.

DAX Table

DAX Table

Step-2: After that one DAX formula screen appears, then write below table constructor code-

Table_2 = {
(1,"Mark", 112),
(3,"John", 121),
(3,"Chan", "Hello")
}
Create table by using DAX

Create table by using DAX

Step-3: After that click on commit icon, and you can see the table has been created under fields pane. It will assign default column name like Value1, Value2 .. , later on you can change the column name.

Right click on column > select Rename.

Table in Power BI by using DAX

Table in Power BI by using DAX

Note: With this solution you cannot set data type for columns at the time creation, as you can see in above DAX code we passed Text & numeric value together for third column.



Way-3: Creating a Table by using DAX DATATABLE function

Step-1: Go to Modeling Tab > click on Table icon.
Step-2: Write below DAX to create a Table.

Datatable =
DATATABLE (
    "Sales Range", STRING,
    "Min Sales", INTEGER,
    "Max Sales", INTEGER,
    {
        { "Low", 0, 1000 },
        { "Medium", 1001, 10000 },
        { "High", 10001, 50000 }
    }
)

Step-3: After that click on commit icon, and you can see the table.

Datatable DAX function Power BI

Datatable DAX function Power BI

With this solution you can set the data type for columns at the time of creation.

Refer more Power BI Post – Power BI

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome.

Leave a Reply