Skip to main content

Power BI

New

When assembling SQL statements in Power Query and connecting to I want to get a WHERE clause parameter from another data source.

Vote (13) Share
Yuho Iwasaki's profile image

Yuho Iwasaki on 30 Jun 2022 02:05:00

When assembling SQL statements in Power Query and connecting to

I want to get a WHERE clause parameter from another data source.


This does not occur if no parameter call is made and a fixed value is set.

The intention is to change the SQL flexibly on the Power BI side.


Comments (1)
Yuho Iwasaki's profile image Profile Picture

Yuho Iwasaki on 30 Jun 2022 02:05:30

RE: When assembling SQL statements in Power Query and connecting to I want to get a WHERE clause parameter from another data source.

exsample:letsql1 ="SELECT Column1 FROM Northwind.dbo.test WHERE yyyymm = '__get_date__'",GetDate = PeriodMonth,sql2 = Text.Replace(sql1, "__get_date__", GetDate),Source = Sql.Database("TEST\SQLEXPRESS", "Northwind", [Query=sql2])in  Source