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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Month difference calculation

Hi,

 

  Please help me  to solve below logic.

 

if date1(Month) column greater than Date2(month) column  and having month difference as 2 month then return "2 month difference"

if date1(Month) column greater than Date2(month) column  and having month difference as 3 month then return "3 month difference"

 

Date1                  Date2                  Expected Calculated column

 

12/30/2019        10/25/2019             2 month difference   

12/30/2019        11/25/2019              1 month difference

12/30/2019         9/25/2019               3 month differnce 

 

 

Regards

Privya

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

2 REPLIES 2
VasTg
Memorable Member
Memorable Member

@Anonymous 

 

I would suggest you to read the documentation on Datediff.

 

https://docs.microsoft.com/en-us/dax/datediff-function-dax

 

If you need to show only positive numbers, use them in IF statement.

 

Connect on LinkedIn
amitchandak
Super User
Super User

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.