Latest Enterprise DNA Initiatives

Count the number of months since a product has been introduced

Hi Team,

I’m very new to DAX and would appreciate guidance on what seems like a simple matter.

I am trying to return the number of months a product has been for sale based on the release month through to today. The release month defined as the first sales month and could be up to 5 years ago.

Any help would be appreciated.


#ofMths bases on ReleaseDate = VAR FirstReleaseDate= FIRSTDATE(SalesTable[ReleaseDate]) VAR DateDiff=NOW()-FirstReleaseDate /this is calculating the number of days between current time and firstDate/releasedate but returns the output in date format/ RETURN DIVIDE(VALUE(DateDiff);30;0) //Formats Date as number and Divide by 30 assuming 30 days per month……You could also use FIRSTNONBLANK based on your releasedate format

Great, thank you. Need to remember the power of VAR for developing intermediary steps to a final calculation.

Much appreciated.