Do you know how to add a column with the same value in Power BI? If not, This Power BI tutorial will help you to create a column with the same value with different data types (like String, Date, Integer, etc.).
Add a column with the same value in Power BI
Let us see how we can add a column with the same value in Power BI.
Example:
- For this scenario, we will use an Excel spreadsheet named Vehicle. This excel sheet has four fields: Car Names, Car Model, Price, and Color. Refer to the screenshot below.
- Here, in the Vehicle excel sheet, we will create a new column with the same values for each row using Power BI. Let’s say, we will add a new column called Manufacture Date which will display the current date and time (and the same value will populate in every row of the spreadsheet).
- So in the same way, we will see how to add a new column in Power BI with different data types (like String, Integer, Decimal, etc.).
Also read: How to add column with a fixed value in Power BI
Add a column with the same value in Power BI using the Date/Time Data type
In the Vehicle sheet, we will add a new column with the same value (Today’s Date & Time) using Power BI. Follow the steps below:
- Open the Power BI Desktop, load the data, select the Modelling tab, and click on the New Column option to create a column.
- Here, we are going to add the same value as Date and Time ( with Date/Time type) in all the rows presented in the table.
- To work around this, apply the below-mentioned formula in the formula box and click on the check icon:
Manufacture Date = TODAY()
Where,
- Manufacture Date = new column name where the current date will store
- TODAY= Function represented the current date and time
- The screenshot below shows that the newly created column displays the same value date with time in the table.
- By default, the current fixed date and time format will be highlighted below:
This is how to add a column with the same value as the Date/Time data type in Power BI.
Check out: How to add column from another table in Power BI [3 Different ways]
Add a column with the same value in Power BI using the Current Day
In the Vehicle sheet, we will add a new column with the same value (Today’s Day) using Power BI. Follow the steps below:
- Open the Power BI Desktop, load the data, select the Modelling tab, and click on the New Column option to create a column.
- Here, we are going to add the same value as the current Day in all the rows presented in the table.
- To work around this, apply the below-mentioned formula in the formula box and click on the check icon:
Manufacture Day = FORMAT(TODAY(),"dddd")
Where,
- Manufacture Day = New column name where the current day will store
- The screenshot below shows that the newly created column displays the same value as the day in the table.
This is how to add a column with the same value as the current day in Power BI.
Have a look: Power Query Add Column [35+ Examples in Power BI]
Add a column with the same value in Power BI using the String Data type
In the Vehicle sheet, we will add a new column with the same value (current month) using Power BI. Follow the steps below:
- Open the Power BI Desktop, load the data, select the Modelling tab, and click on the New Column option to create a column.
- In this example, we are going to add the same value as October ( with String data type) in all the rows presented in the table.
- For that, apply the below-mentioned formula in the formula box and click on the check icon:
Manufacture Month = "October"
Where,
- Manufacture Month = New column name where the current Month value gets stored
- October = Static String type
- The screenshot below shows that the newly created column displays the same value as October for all the rows presented in the table.
This is how to add a column with the same value with string data type in Power BI.
Read: How to Filter Power BI Dax Based On Condition
Add a column with the same value in Power BI using the Integer Data type
In the Vehicle sheet, we will add a new column with the same value (current year) using Power BI. Follow the steps below:
- Open the Power BI Desktop, load the data, select the Modelling tab, and click on the New Column option to create a column.
- In this example, we will add the same value as 2022 ( with String data type) in all the rows presented in the table.
- For that, apply the below-mentioned formula in the formula box and click on the check icon:
Manufacture Year = 2022
Where,
- Manufacture Year = New column name where the current year will store
- 2022 = Static Integer type
- The screenshot below shows that the newly created column displays the same value as the current year (i.e. 2022) in the table.
This is how to add a column with the same value with integer data type in Power BI.
Check out: How to Append Columns in Power Query
Add a column with the same value in Power BI using the Decimal Data type
In the Vehicle sheet, we will add a new column with the same value (Mileage) using Power BI. Follow the steps below:
- Open the Power BI Desktop, load the data, select the Modelling tab, and click on the New Column option to create a column.
- In this example, we will add the same value as 17.1 ( with Decimal data type) in all the rows presented in the table.
- For that, apply the below-mentioned formula in the formula box and click on the check icon:
Mileage = 17.1
Where,
- Mileage = New column name where the mileage value gets stored
The screenshot below shows that the newly created column displays the same value as 17.1 for all the rows presented in the table.
This is how to add a column with the same value as the Decimal data type in Power BI.
Also, you may like the below Power BI Tutorials:
- Power Query Add Column If Statement
- How to Filter Date using Power BI DAX
- How to merge columns in Power Query
- How to Merge Column in Power BI
- Power BI Slicer Multiple Columns
- Power BI Create Table From Another Table
This Power BI tutorial explained how to add a column with the same value in Power BI. Also, we will cover the topics below:
- What does the mean of adding a column with the same value in Power BI
- How to add a column with the same value in Power BI using the Date/Time Data type
- How to add a column with the same value in Power BI using the Current Day
- How to add a column with the same value in Power BI using the String Data type
- How to add a column with the same value in Power BI using the Integer Data type
- How to add a column with the same value in Power BI using the Decimal Data type
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com