//Metadata: //Programming language: DAX //Natural language: English //Output: numeric //Explanation: //this measure generates a date duration with dynamic formatting //How to use: //Copy the code into PBI when creating a Dax measure Duration = VAR DurationDays = DATEDIFF ( MIN ( Table[date] ), TODAY (), DAY ) // insert your table and column name here VAR DurationYears = DurationDays / 365 VAR DurationMonths = DurationDays / 30 RETURN IF ( DurationDays > 364, FORMAT ( DurationYears, "# Years" ), FORMAT ( DurationMonths, "# Months" ) )