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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ruben_BE
Frequent Visitor

Add a column with the sheet name

Hi all,

 

after getting my data from an Excel sheet, I want to add a column with the name of the worksheet (not the workbook) as a value.

 

Example:

I get my data from Actuals2018.xlsx with sheets January , February , March , ....

 

The table in the sheet January has three columns as follows:

Date - Customer - Amount

 

I want to add a column named "Month" whith the value of the worksheet name which is "January" in this example.

 

Can someone help me out?

 

Thank you very much in advance!

 

Br,

Ruben.

1 ACCEPTED SOLUTION

@ruben_BE

Yes. You can create a custom column based on the Date field.

Date.MonthName([Date],"en-us")

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@ruben_BE,

In Power BI Desktop query editor, you can add a column from an example for each query.

1.PNG2.PNG3.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

 

thank you for reply. 

 

When applying this method, I don't get to adding the 'Table name' or de 'Worksheet name' as a value in a new column. I can only create a new column based on values in other columns.

 

Thank you very much for your assistance!

 

Best regards,

Ruben.

@ruben_BE

Yes. You can create a custom column based on the Date field.

Date.MonthName([Date],"en-us")

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.