March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi DAX Expert,
I need the DAX formula to calcuate the Year , Months and Days between the 2 given dates as seen in the following screen print, however as seen I am not getting the required output, Please assist with the correct formula. Thanks
Regards
Suhel
Solved! Go to Solution.
@Suhel_Ansari , One of the way id have diff days and convert into month using 365 day and 30 days logic
new column =
var _diff = datediff([registration Date], [date of last known distance], day)
return
quotient(_diff , 365) & " Years " & quotient(mod(_diff , 365) ,30) & " Months " & mod(mod(_diff , 365) ,30)
@Suhel_Ansari , One of the way id have diff days and convert into month using 365 day and 30 days logic
new column =
var _diff = datediff([registration Date], [date of last known distance], day)
return
quotient(_diff , 365) & " Years " & quotient(mod(_diff , 365) ,30) & " Months " & mod(mod(_diff , 365) ,30)
@amitchandak , It partially working The year and Month are correct however Days are calcualting wrong as shown in attached screen print. Thanks
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
78 | |
67 | |
52 |
User | Count |
---|---|
199 | |
140 | |
96 | |
77 | |
68 |