cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DSwezey
Helper II
Helper II

Create Date column from Year and Month columns

I have a table with a column of Month NUmber and a column for Year. I want to make a date column for the 1st of the month. The new column I want to be formatted [Month Number]/1/[Year] 

Example: the second row is February 2021. I want the new date column to look like 2/1/2021.

 

DSwezey_0-1637781833540.png

 

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@DSwezey  this was to be done in PQ.

For DAX use this 

Column = DATE('Table'[Year],'Table'[Month Number],1)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


View solution in original post

4 REPLIES 4
smpa01
Super User
Super User

@DSwezey  this was to be done in PQ.

For DAX use this 

Column = DATE('Table'[Year],'Table'[Month Number],1)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


smpa01
Super User
Super User

@DSwezey  create a new column as 

#date([Year],[Month Number],1)

and then format as you wish through DAX





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


I get this error when adding the custom column. 

DSwezey_0-1637783203939.png

 

ronrsnfld
Responsive Resident
Responsive Resident

date <> #date

 

change 

 

date([Year],[Month Number],1)

 

to (as written by @smpa01 )

     

 

#date([Year],[Month Number],1)

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Top Solution Authors