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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ADSL
Post Prodigy
Post Prodigy

Add Column Month & Year in Power Query

Hi BI Community Team,

 

I am getting error as the screenshot when trying to add/combine the column Month No. & Year to new column as the format: 1/1/2022 ---- 1/12/2022.

 

In Custom column formula = #date([Month No],[Year],1)

 

2023-04-14_08-34-32.png

 

2023-04-14_08-39-44.png

 

Any suggestion/advise of this case?

 

Thanks and Regards,

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @ADSL 

how about:

= #date([Year], [Month No],1)

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @ADSL

AFAIK, #date should be in this order - year, month, day.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
FreemanZ
Super User
Super User

hi @ADSL 

how about:

= #date([Year], [Month No],1)

Ritaf1983
Super User
Super User

Hi @ADSL 
There are several ways to achieve your date format.
You can use the "column from example" functionality as follows:
1. Select the year and month columns

Ritaf1983_0-1681439238367.png

2. Add column from example

Ritaf1983_1-1681439295824.png

3 . In 2-3 lines, type the date in the desired format + press ok

(2 was enough for me, and he understood the logic)

Ritaf1983_3-1681439487143.png

4. Chnge data type to "date"

Ritaf1983_4-1681439625598.png

 

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.