cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Creating a new column with a cell value

Hi guys,

I want to create a column with a specific cell value which is located in the headline of the table, is there any way to do this? the picture below is an example of what I am trying to do.

I have tried this but it give me an error

= Table.AddColumn(#"Changed Type", "Custom", each {2}[Column3])

Untitled.png

Thank you for your help in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Re: Creating a new column with a cell value

Hi Hamidrezaei,

There are a couple ways to do this.  The "easy" but brute force way is just to add a custom column to the table/query and enter the date.  Then, just trim out the rows you don't need.

 

ColumnA.png

 

ColumnB.png

 

 

A more "system" type approach would be to promote headers, making that date a column header, then unpivot that column.  Then, you would have to remove rows and promote headers and then rename the date to whatever the name is:

 

Initial Promoted HeadersInitial Promoted Headers

 

UnpivotUnpivot

 

 

Remove Rows, Promote Headers, Rename Date FieldRemove Rows, Promote Headers, Rename Date Field

 

 

 

 

View solution in original post

3 REPLIES 3
Highlighted
Continued Contributor
Continued Contributor

Re: Creating a new column with a cell value

Hi Hamidrezaei,

There are a couple ways to do this.  The "easy" but brute force way is just to add a custom column to the table/query and enter the date.  Then, just trim out the rows you don't need.

 

ColumnA.png

 

ColumnB.png

 

 

A more "system" type approach would be to promote headers, making that date a column header, then unpivot that column.  Then, you would have to remove rows and promote headers and then rename the date to whatever the name is:

 

Initial Promoted HeadersInitial Promoted Headers

 

UnpivotUnpivot

 

 

Remove Rows, Promote Headers, Rename Date FieldRemove Rows, Promote Headers, Rename Date Field

 

 

 

 

View solution in original post

Highlighted
Frequent Visitor

Re: Creating a new column with a cell value

Thank you @collinq 

The unpivot works!

Highlighted
Frequent Visitor

Re: Creating a new column with a cell value

Hi @collinq 

The problem with the unpivoting is that the date is changed every day , so the column name is not recognized the next day. Is there any other way to do this? 

 

 

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors
Top Kudoed Authors