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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anders_G
Helper I
Helper I

Help with M expression - Create custom column based on Date

Hi,

 

I need help writing an M expression for a custom column in Power Query

 

I have a column with dates called "Initial Date". Depending on the quarter in which the date falls I want to create a new custom column "Desired Date" that gives the first day of the next quarter. Quarters are running from Jan-Mar etc. In the example below 2022-01-01 should return 2022-04-01 and 2022-05-03 should return 2022-07-01.

 

Anders_G_0-1659605275892.png

 

Thank you!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anders_G , Try one of the two in power query as a new column

 


Date.AddQuarters([Column],1)

 

 

Date.StartOfQuarter(Date.AddQuarters([Column],1))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anders_G , Try one of the two in power query as a new column

 


Date.AddQuarters([Column],1)

 

 

Date.StartOfQuarter(Date.AddQuarters([Column],1))

That worked very well. Thank you very much!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.