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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RichJW
Helper III
Helper III

Date format in a DAX formula

Hi,

 

I have a column of data, which is in date format dd/mm/yy.

I need to change every date in the column that is earlier than 01/01/18, to show 01/01/18. So, if the date is 04/02/18, then it stays as it is, however if the date is 08/12/17, then it needs to show as 01/01/18.

 

I've tried various formulae with no success...

GanttStartDate = IF(Projects[ProjectStartDate].[Date]<01/01/18,01/01/18,Projects[ProjectStartDate].[Date])

GanttStartDate = IF(Projects[ProjectStartDate]<01/01/18,01/01/18,Projects[ProjectStartDate].[Date])

GanttStartDate = IF(Projects[ProjectStartDate]<01/01/18,01/01/18,Projects[ProjectStartDate])

 

Can anyone please advise a suitable formula?

 

Many thanks,

Rich

1 ACCEPTED SOLUTION
petrovnikitamai
Resolver V
Resolver V

try this

GanttStartDate = IF(Projects[ProjectStartDate]<DATE(2018,01,01),DATE(2018,01,01),Projects[ProjectStartDate])

use dax function DATE()

View solution in original post

2 REPLIES 2
petrovnikitamai
Resolver V
Resolver V

try this

GanttStartDate = IF(Projects[ProjectStartDate]<DATE(2018,01,01),DATE(2018,01,01),Projects[ProjectStartDate])

use dax function DATE()

You, my friend, are wonderful Man Happy

 

Thanks so much.

I even like the touch of missing out the closing square bracket after projectstartdate, so I didn't just copy paste! Man Happy

 

Cheers,

Rich

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!

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.

Top Solution Authors
Top Kudoed Authors