Reputation: 103
I would like to include the contents of a named range in a custom column in a power query.
I have created a named range cell in excel which holds a date value, then created a blank query with Function and am calling that into a custom column in another query - all based on this users question/answer How can I reference a cell's value in a Power Query.
When trying to call the function (named range) into the custom column in my query I am receiving an Expression.Error:
I have tried Date.ToText, formatting the column in Transform -> Data Type and receive the same error but with different messages, eg. instead of #datetime it would be value.
This is my line of code in advanced editor that is calling the named range (date).
#"Added Custom1" = Table.AddColumn(#"Filtered Rows2", "Date2", each Excel.Workbook(File.Contents(GetDate("FNEndDate"))))
Upvotes: 0
Views: 938
Reputation: 2967
If you just want to add a column with the value from the named range, just remove the Excel.Workbook(File.Contents part:
#"Added Custom1" = Table.AddColumn(#"Filtered Rows2", "Date2", each GetDate("FNEndDate"))
Upvotes: 2