Forum Discussion
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.
- Anonymous7 years ago
ruben_BE,
Yes. You can create a custom column based on the Date field.Date.MonthName([Date],"en-us")
Regards,
Lydia
3 Replies
- AnonymousNot applicable
ruben_BE,
In Power BI Desktop query editor, you can add a column from an example for each query.
Regards,
Lydia- ruben_BEFrequent Visitor
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.
- AnonymousNot applicable
ruben_BE,
Yes. You can create a custom column based on the Date field.Date.MonthName([Date],"en-us")
Regards,
Lydia