Hi,
I want to calculate year and months from two dates. Actually, I am replicating excel like functionality into PowerApps.
In Excel I have below formula.
Get Month =DATEDIF(B6,B7, "ym")
Get Year =DATEDIF(B6,B7, "y")
Below the output I am getting.

But when i am trying to enter the same dates and calculating them then getting the below results.

I am using the below PowerFX code.
DateDiff(
Start.SelectedDate,
End.SelectedDate,
TimeUnit.Years
) & " Years " & Mod(
DateDiff(
Start.SelectedDate,
End.SelectedDate,
TimeUnit.Months
),
12
) & " Months "
Now sure why and where is the problem. I would be really glad to have help on this.
Warm Regards,
Akshay