Forum Discussion
Expression.Error: 1 arguments were passed to a function which expects 0.
- 5 years ago
I was still having problems implementing some of the solutions proposed so I ended up generating the additional fields in excel and just started with a data source that had the fields already. Thanks everyone for trying to help me out. Hopefully after some time I will have a better grasp on Power Query vis-à-vis Power BI and can circle back to implement what you've suggested here.
Cheers!
But then I get the following Expression.Error: We couldn't find an Excel table named 'Dates'.
How do I set or indicate the current workbook?
cathoms - manually connect to the Excel table using the UI and connect to the Date table. You will get code that looks like this:
let
Source = Excel.Workbook(File.Contents("C:\Users\filepath\Book1.xlsx"), null, true),
Dates_Table = Source{[Item="Dates",Kind="Table"]}[Data]
in
Dates_Table
You need to put those two lines of code after the quarter/period, but before the Changed Type step, and your change type step should point to Dates_Table. My data was in an Excel table called Dates.
See this article if you need help using this M code in your model.