Unfortunately, there is no Datediff function in PowerAutomate, so here is our solution to calculate the number of months between two dates.
Our data:
Date 1 = Current date, here we use the current date
Date 2 = A date field from SharePoint
SharePoint is the intranet solution from Microsoft. SharePoint Online SharePoint online (SPO) is usually included in your Microsoft 365 subscription, but can also be purchased directly. SharePoint Online has the advantage that there is no need to operate a separate server, but it lacks the customization options of a self-hosted installation of SharePoint.Although SharePoint Online is limited to core functions... with the name Contract start
Jahresunterschied herausfinden
Mit folgender Formel finden wir den Jahresunterschied heraus:sub(int(formatDateTime(body('Aktuelle_Zeit'), 'yyyy')), int(formatDateTime(outputs('Projektinfos_abrufen')?['body/Vertragsbeginn'], 'yyyy')))
Calculate delta of months
sub(int(formatDateTime(body('Aktuelle_Zeit'), 'MM')), int(formatDateTime(outputs('Projektinfos_abrufen')?['body/Vertragsbeginn'], 'MM')))
Combining the year difference and the months
add(mul(outputs('Delta_der_Jahre'), 12), outputs('Delta_der_Monate'))
Dieser Beitrag ist auch verfügbar auf: Deutsch (German)