Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
119 | |
75 | |
47 | |
44 | |
34 |
User | Count |
---|---|
179 | |
89 | |
69 | |
47 | |
47 |