Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
This is what I have typed and it works in power query without errors.
let
StDt = [STARTDATE],
AllDates =
{Number.From([STARTDATE])..Number.From([ENDDATE])},
StofMonthDate =
List.Distinct(
List.Select(
List.InsertRange(
List.Transform(
AllDates,
each Date.StartOfMonth(Date.From(_))
),
0,
{[STARTDATE]}
),
each Number.From(_) >= Number.From(StDt)
)
)
in
StofMonthDate
But when I try to load the data, I get an error:
OLE DB or ODBC error: [Expression.Error] We cannot apply operator .. to types Null and Number..
I removed blanks in [end_date] and [start_date] but gets the same error. Please help
Solved! Go to Solution.
The first statement has to be a Source statement. That source should have columns like STARTDATE and ENDDATE.
OR
You will need to allocate some value to STARTDATE and ENDDATE variables. The moment you say [STARTDATE], it expects it to come from a table.
The first statement has to be a Source statement. That source should have columns like STARTDATE and ENDDATE.
OR
You will need to allocate some value to STARTDATE and ENDDATE variables. The moment you say [STARTDATE], it expects it to come from a table.
Those are from my table. STARTDATE and ENDDATE are available in the table
Please post your complete query alongwith Source statement.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.