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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
JemmaD
Helper V
Helper V

Calculated Column for Months from Today

I need to create a calculated DAX column to tell me the number of months from today. 

So any rows where the date is in this month for example would show 0

Rows for last month would be 1

Rows for six months ago would be 6

Next month I guess would be -1

 

I tried this but without the year included it doesn't work once we get to the previous year

= MONTH(TODAY()) - MONTH([DATE])+1

 

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @JemmaD DATEDIFF like this

 

MonthsFromToday =
DATEDIFF (
    DATE(YEAR([Date]), MONTH([Date]), 1),
    DATE(YEAR(TODAY()), MONTH(TODAY()), 1),
    MONTH
)
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

View solution in original post

3 REPLIES 3
techies
Super User
Super User

Hi @JemmaD DATEDIFF like this

 

MonthsFromToday =
DATEDIFF (
    DATE(YEAR([Date]), MONTH([Date]), 1),
    DATE(YEAR(TODAY()), MONTH(TODAY()), 1),
    MONTH
)
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified
ryan_mayu
Super User
Super User

do you want to create a column or a measure? could you pls provide some sample data and expected output?





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

Proud to be a Super User!




lbendlin
Super User
Super User

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.