Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
could anybody help me with solving problem with dates range in source?
I need to get from database named AccountData only dates (Date1) which are within range set in excel workbook.
In current excel workbook there are set dates uDateFrom=1.7.2021 and uDateTo=5.7.2021, those two dates are the range.
I am actually new to power query and even i tried to search i could not find a solution for it. The query i wrote is not working:
let
Source = Odbc.Query("dsn=usr_MJ", "use Data0003;#(lf)Select Account_number, Date1 from AccountData where (Date1>=Date.From(Excel.CurrentWorkbook(){[Name="uDateFrom"]}[Content]{0}[Column1]) and Date1<=Date.From(Excel.CurrentWorkbook(){[Name="uDateTo"]}[Content]{0}[Column1]))")
in
Source
I will be very thankfull for help
Martina
Here is what you do:
let
Source = Odbc.Query("dsn=usr_MJ") -----you may need to change this
FilterData = Table.SelectRows(Source, each [Date1] >= varStartDate and Date1<=varEndDate)
in
FitlerData
I don't think you can pass a parameter from an excel file back to a native ODBC query like you are trying. The filter needs to happen in Power Query.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingShare feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |