1
votes

I'm looking at this example, and this should work: https://www.simple-talk.com/sql/reporting-services/power-query-formula-language-in-power-bi-desktop/

However, i'm getting a "Token In expected" error.

Here's the code:

let
    #"Datasource" = let
    Source = Sql.Databases("111.111.111.111"),
    DSN = Source{[Name="DSN"]}[Data],
    #"dbo_Datasource" = DSN{[Schema="dbo",Item="Datasource"]}[Data],
    BlockFilter = Table.SelectRows(#"dbo_Datasource", each ([block] <> "")),
    AddColQTR = Table.AddColumn(BlockFilter , "Start_Of_QTR", each Date.StartOfQuarter(DateTime.LocalNow()))
in
   AddColQTR
1

1 Answers

6
votes

You have 2x "let" and 1 "in"; each "let" should have a corresponding "in".

It looks to me that you should remove the line: #"Datasource" = let