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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

OLE DB or ODBC error: [Expression.Error] We cannot apply operator .. to types Null and Number..

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

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

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. 

View solution in original post

3 REPLIES 3
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

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. 

Anonymous
Not applicable

Those are from my table. STARTDATE and ENDDATE are available in the table

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Please post your complete query alongwith Source statement.

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.