Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Power Query - Accessing Cell Value to Power Query

I have this below line of code. I have made a table with the name DateInput and it has column Date 

 

Source = Sql.Database("-----", "---", [Query="select * FROM --- WHERE WeekEnd = 'Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0}'"]),

 

It's showing the error as Toek Comma Expected. While clicking on error it's highlighting DateInput

3 REPLIES 3
artemus
Microsoft Employee
Microsoft Employee

Since the item is a date type, you would need to wrap Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0} inside a Text.From

that is:

Text.From(Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0})

artemus
Microsoft Employee
Microsoft Employee

Try this:

Source = Sql.Database("-----", "---", [Query="select * FROM --- WHERE WeekEnd = '" & Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0} & "'"]),

Anonymous
Not applicable

After using this, it's showing below error

 

Expression.Error: We cannot apply operator & to types Text and DateTime.
Details:
Operator=&
Left=select * FROM ----
WHERE WeekEnd = '
Right=3/18/2023 12:00:00 AM

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors