Hybrid Tables are an incredibly powerful feature in Power BI. But what if you wanted to create them outside of Power BI Desktop? Patrick shows you how you can do just that in Tabular Editor!

–This Year
let
Source = Sql.Databases(“servername”),
AdventureWorksDW = Source{[Name=”databasename”]}[Data],
internetsales = AdventureWorksDW{[Schema=”dbo”,Item=”pbi_InternetSales”]}[Data],
thisyear = Table.SelectRows(internetsales, each Date.IsInCurrentYear([OrderDate]))
in
thisyear

–Last Year
let
Source = Sql.Databases(“servername”),
AdventureWorksDW = Source{[Name=”databasename”]}[Data],
internetsales = AdventureWorksDW{[Schema=”dbo”,Item=”pbi_InternetSales”]}[Data],
lastyear = Table.SelectRows(internetsales, each Date.IsInPreviousYear([OrderDate]))
in
lastyear