To fetch sheet name in Power BI for the custom column value
- User
To fetch sheet name in Power BI for the custom column value
- Assistant
To fetch the sheet name in Power BI for a custom column value, you can use the 'Excel.CurrentWorkbook' function along with the 'Table.Column' and 'Table.FirstN' functions. Here is an example of the syntax you can use:
-
First, create a custom column by clicking on the 'Add Column' tab in the Power Query Editor.
-
In the formula bar, enter the following formula:
= Excel.CurrentWorkbook(){[Name= "YourTableName"]} [Content]
Replace 'YourTableName' with the name of your table in Power BI.
-
This formula fetches the content of the current workbook table specified.
-
Next, you can use the 'Table.Column' function to extract the specific column value from the table. For example:
= Table.Column(YourCustomColumnName, "Sheet Name")
Replace 'YourCustomColumnName' with the name of the custom column you created.
-
Finally, you can use the 'Table.FirstN' function to select the first value from the column. For example:
= Table.FirstN(YourColumnName, 1)
Replace 'YourColumnName' with the name of the column you extracted the sheet name from.
-