Forum Discussion
Power Bi – query or formula to Get Table name
Thanks jbwtp
One of the above suggestions is using import from folder method for your queries. This is if there are several Excel files.
My data source is 1 Excel spreadsheet, with 6 different tabs. Each tab has the same columns, each tab is a different department.
Workarounds can be either:
in the Excel Spreadsheet add a new Column for 'Department'. A formula to obtain the tab Name which is the Deparment Name.
or, as you suggested ..
in PowerBI, Add a new Column 'Department' with a fixed value that is the department name.
In .NET code, intellisense provides property data information (for most objects properties). I thought the same would be available in PowerBI Query.
Many thanks
Hi dd88,
This is a bit different to the functionality available in M.
Excel, actually, exposes the internal file structure through the connector, and you should be able to see all tab names on one of the importing steps, I think this is Excel.Workbook(). You can use the list of tabs returned on this step to assign the value for your column dynamically.
Cheers,
John