I'm trying to copy excel query into PowerBI query. In excel I have
let
Source = Csv.Document(File.Contents(Excel.CurrentWorkbook(){[Name="Request"]}[Content]{2}[Path]),null,{0, 55, 62, 134, 145, 386, 398, 410},null,1200),
#"Appended Query" = if Date.Month(Excel.CurrentWorkbook(){[Name="Request"]}[Content]{5}[start])=Date.Month(Excel.CurrentWorkbook(){[Name="CurrentDate"]}[Content]{0}[CurrentDate]) then Source else Table.Combine({Source, Csv.Document(File.Contents(Excel.CurrentWorkbook(){[Name="Request"]}[Content]{3}[Path]),null,{0, 55, 62, 134, 145, 386, 398, 410},null,1200)}),
In excel this works all good but in Power BI I get error. ( In excel howering over the query it shows data source: X:...... .txt ) I tried copying the file path into the code but because of the "Date" section I still get errors.
Expression.Error: We couldn't find an Excel table named 'Request'. Details: Request.
Excel.CurrentWorkbook(){[Name="Request"]
andExcel.CurrentWorkbook(){[Name="Request"]}[Content]{5}[start]
with the path of the file gives error:Expression.Error: The Date value must contain the Date component.
– user245255