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

Create a measure to find difference between two dates

Hi everyone,

 

I want to create a measuere to find the difference in months between two dates. One date is from the dataset and the other is TODAY() function. Could anyone please suggest on how can I create this measure?

 

Thank you

 

Best Regards,

DG

1 ACCEPTED SOLUTION

If you are trying to point on your column, and if it's a one row value then try this code

Measure = DATEDIFF(MAX(Your_date),TODAY(),MONTH)

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated

View solution in original post

8 REPLIES 8
DataVitalizer
Solution Sage
Solution Sage

Hi @Anonymous 

You can use this code to acheive your need
Measure = DATEDIFF(Your_date,TODAY(),MONTH)

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated

Anonymous
Not applicable

It is not working for me. 

Could you please suggest some other way ?

Could you provide a data sample or a screenshot so I can understand more your need

Anonymous
Not applicable

I want to find difference of months between LAST_ORDER_DATE and TODAY() and LAST_ORDER_DATE is already in the database. but when I do MEASURE = DATEDIFF( in this place after opening bracket I'm unable to refer to column named LAST_ORDER_DATE. 

Anonymous
Not applicable

Hi ,

 

        you can use Values function. e.g  Values(LAST_ORDER_DATE) to refer the  column.

 

Thanks,

Shanthakumar

If you are trying to point on your column, and if it's a one row value then try this code

Measure = DATEDIFF(MAX(Your_date),TODAY(),MONTH)

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated

Anonymous
Not applicable

Thank you so much for your help It worked.

 

Regards

You are welcome 👍

 

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated

 

 

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