Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Build a Custom Column with two values for Year

I am trying to build a custom column that will give two year values for each row. Essentially repeating each row and ending with 2019 for the first row and 2020 for the second row.
a3.jpg

The final goal would have two rows for each hotel name:
HotelName                                   Year
aloft Birmingham Soho Square    2019
aloft Birmingham Soho Square    2020
aloft Chapel Hill                            2019
aloft Chapel Hill                            2020 
etc....

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

what you are trying to achieve can not be done in Power BI directly, you will have to make use of Power Query.

 

1. Create a table with the years you need, by using the "Enter Data"-function in Power Query. Call it e.g. Years.

2. In your Hotel-table, use the "Add Custom Column"-function, and add the Years-table. It will not be visible in the pop-up window, so you will have to manually type the name.

3. You will now see a new column labled Years(or whatever you called it), with a small Expand-button in the header of the column. Click on this, and voila.

mockup

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

View solution in original post

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

what you are trying to achieve can not be done in Power BI directly, you will have to make use of Power Query.

 

1. Create a table with the years you need, by using the "Enter Data"-function in Power Query. Call it e.g. Years.

2. In your Hotel-table, use the "Add Custom Column"-function, and add the Years-table. It will not be visible in the pop-up window, so you will have to manually type the name.

3. You will now see a new column labled Years(or whatever you called it), with a small Expand-button in the header of the column. Click on this, and voila.

mockup

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.