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

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

Reply
Anonymous
Not applicable

How to change the day portion of the date to "1".

Hi Everyone,

I've a date where I've a range for 2 years and in this range I want to change all the days to 1st of that month. How can I do that I am working with directquery.

Thanks

1 ACCEPTED SOLUTION
selinaz
Resolver II
Resolver II

Hi @Anonymous ,

 

The Direct query connection mode is very restrictive for DAX functions, in another word, most DAX statements may not be supported in this mode, hence your error above. The more recommended method  for you is to write the relevant SQL statements directly when connecting to the data source, to present the data you need precisely to the desktop.

selinaz_0-1660205191856.png

 

Best regards, 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly .

View solution in original post

7 REPLIES 7
selinaz
Resolver II
Resolver II

Hi @Anonymous ,

 

The Direct query connection mode is very restrictive for DAX functions, in another word, most DAX statements may not be supported in this mode, hence your error above. The more recommended method  for you is to write the relevant SQL statements directly when connecting to the data source, to present the data you need precisely to the desktop.

selinaz_0-1660205191856.png

 

Best regards, 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly .

tamerj1
Super User
Super User

Hi @Anonymous 
You can use

EOMONTH ( TableName[Date], -1 ) + 1

Anonymous
Not applicable

Hi @tamerj1 ,

Thanks for responding.

I've checked "EOMONTH" but It does not work in directquery mode.

@Anonymous 

Try

=
DATE ( YEAR ( TableName[Date] ), MONTH ( TableName[Date] ), 1 )
Anonymous
Not applicable

No luck with this one as well.

Date issue.png

@Anonymous 
Have tryed creating it as a measure instead of a column? is this a valid option fro your case?

Anonymous
Not applicable

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.