Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 |
---|---|
141 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
123 | |
101 | |
71 | |
61 |