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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
naeljb
Helper I
Helper I

date format transformation into a new column

Hi,

 

I have a date column format (month ,day, year) ranging from January 2015 to December 2017.  I would like to create a new column such as January 2015 to May 2016 is recorded as 1,  June 2016 to January 2017 as 2, Feb 2017 to Dec 2017 as 3.  Is there a Dax function allowing such transformation? Or what would be the DaX formula in powerbi?  

 

Thanks,

1 ACCEPTED SOLUTION
JP-Ronse
Helper II
Helper II

Hi,

 

This is my first proposal as a solution, pretty sure there are better answers and please don't laugh too hard (experts).

 

=if([Date]<=date(2016,05,31),1,if([Date]<=date(2017,01,31),2,3))

View solution in original post

2 REPLIES 2
JP-Ronse
Helper II
Helper II

Hi,

 

This is my first proposal as a solution, pretty sure there are better answers and please don't laugh too hard (experts).

 

=if([Date]<=date(2016,05,31),1,if([Date]<=date(2017,01,31),2,3))

Yup..... It works perfectly. Laughting at myself as it was so simple, an IF function.  Thanks soooo much you JP-Ronse

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.