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!
Hi, cathoms , in fact, this expression in your code throws the error
Source = Excel.CurrentWorkbook("C:\Users\cathoms\OneDrive – My Organization\Project Areas\QMDashboard\Dates.xlsx"){[Name="Dates"]}[Content],
It's a syntax error because Excel.CurrentWorkbook requires no parameter.
Source = Excel.CurrentWorkbook(){[Name="Dates"]}[Content],Here's the reference: https://docs.microsoft.com/en-us/powerquery-m/excel-currentworkbook
- cathoms5 years agoResponsive Resident
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?
- edhans5 years agoCommunity Champion
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_TableYou 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.
- CNENFRNL5 years agoCommunity Champion
Attach you workbook pls and I'll show you full steps. I can't make a guess out of anything.