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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

extract year and month from date

i have a date column now i want to extract month and year from date column .. how i do this 

i want to do this in table .. 

this automated date hierachy is created but not visible in table 

bakhtawarashiq_0-1663896782819.png

 

1 ACCEPTED SOLUTION
johncolley
Solution Sage
Solution Sage

Hi @Anonymous , on the table with your date field you can create the following:

 

Year = YEAR(datefield)
Month = MONTH(datefield) this returns a number from 1-12
MonthName = FORMAT(datefield, "MMM")

 

If this answer solves your problem please mark it as a solution!

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous ,

 

You  can  use FORMAT function in DAX which works similarly as text in Excel.

So  for month name, you can  create a calculated column with

Month Name = 
FORMAT ( Table'[Date], "mmmm" )

For year

YEAR = 
FORMAT ( Table'[Date], "yyyy" )

 or

Year = 
YEAR('Table'[Date])

 





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.
johncolley
Solution Sage
Solution Sage

Hi @Anonymous , on the table with your date field you can create the following:

 

Year = YEAR(datefield)
Month = MONTH(datefield) this returns a number from 1-12
MonthName = FORMAT(datefield, "MMM")

 

If this answer solves your problem please mark it as a solution!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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