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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.