Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi
I am joining two Tables into one from SQL Server but the code results in an error, might needs correction as I tried to get an idea from the Internet.
let
Source1 = Sql.Database("Database_Name", "SubReporting"),
Reporting_Table1 = Source{[Schema="Reporting",Item="Table1"]}[Data],
#"YearToDate Filter" = Table.SelectRows(Reporting_Table1, each Date.IsInYearToDate([InvoiceApprovedDate])),
#"Filtered Entity" = Table.SelectRows(#"YearToDate Filter", each ([ColumnA] = "Condition1"))
Source2 = Sql.Database("Database_Name", "SubReporting"),
Reporting_Table2 = Source{[Schema="Reporting",Item="Table2"]}[Data],
#"YearToDate Filter" = Table.SelectRows(Reporting_Table2, each Date.IsInYearToDate([DeliveryDate])),
#"Filtered Column" = Table.SelectRows(#"YearToDate FIlter", each ([ColumnA] = "Condition1")),
#"Result"=Table.Combine({Source1,Source2})
in
#"Result"
Well, for one thing you are missing a comma:
let
Source1 = Sql.Database("Database_Name", "SubReporting"),
Reporting_Table1 = Source{[Schema="Reporting",Item="Table1"]}[Data],
#"YearToDate Filter" = Table.SelectRows(Reporting_Table1, each Date.IsInYearToDate([InvoiceApprovedDate])),
#"Filtered Entity" = Table.SelectRows(#"YearToDate Filter", each ([ColumnA] = "Condition1")),
Source2 = Sql.Database("Database_Name", "SubReporting"),
Reporting_Table2 = Source{[Schema="Reporting",Item="Table2"]}[Data],
#"YearToDate Filter1" = Table.SelectRows(Reporting_Table2, each Date.IsInYearToDate([DeliveryDate])),
#"Filtered Column" = Table.SelectRows(#"YearToDate Filter1", each ([ColumnA] = "Condition1")),
#"Result"=Table.Combine({#"Filtered Entity",#"Filtered Column"})
in
#"Result"
Hi Greg, I used this code and changed the Table & Column names but it results in the same error which I was previously.
let
Source1 = Sql.Database("", ""),
Reporting_Table1 = Source1{[Schema="Reporting",Item="Table1"]}[Data],
#"YearToDate Filter1" = Table.SelectRows(Reporting_Table1 , each Date.IsInYearToDate([Date])),
#"Filtered1" = Table.SelectRows(#"YearToDate Filter1", each ([Column1] = "Value1")),
Source2 = Sql.Database("", ""),
Reporting_Table2 = Source{[Schema="Reporting",Item="Table2"]}[Data],
#"YearToDate Filter2" = Table.SelectRows(Reporting_Table2, each Date.IsInYearToDate([Date])),
#"Filtered2" = Table.SelectRows(#"YearToDate Filter2", each ([Column] = "Value1")),
#"Result"=Table.Combine({#"Filtered1",#"Filtered2"})
in
#"Result"
Errors



Thanks
Prajot
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 35 | |
| 28 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 59 | |
| 58 | |
| 40 | |
| 22 | |
| 20 |