Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
102 | |
92 | |
85 | |
78 | |
71 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |