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

How to add columns name as a row in new column?

I wan to show some column names as a row in new column.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Alice08 ,

I created some data:

Table:

vyangliumsft_0-1675931410636.png

 

Here are the steps you can follow:

1. Create calculated column.

You can use NAMEOF() functions to get table and column names:

NAMEOF('Table'[A])

vyangliumsft_1-1675931410638.png

 

You can use the Mid() function to intercept:

Column =
MID(
    NAMEOF('Table'[A]),9,1) &""& MID( NAMEOF('Table'[B]),9,1)

2. Result:

vyangliumsft_2-1675931410638.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Alice08 ,

I created some data:

Table:

vyangliumsft_0-1675931410636.png

 

Here are the steps you can follow:

1. Create calculated column.

You can use NAMEOF() functions to get table and column names:

NAMEOF('Table'[A])

vyangliumsft_1-1675931410638.png

 

You can use the Mid() function to intercept:

Column =
MID(
    NAMEOF('Table'[A]),9,1) &""& MID( NAMEOF('Table'[B]),9,1)

2. Result:

vyangliumsft_2-1675931410638.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

wdx223_Daniel
Super User
Super User

NewStep=Table.Unpivot(PreviousStepName,{"ColumnName"},"ColumnName","Value")

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors