I have need to convert an accounting period into a date and it is not formatting properly.
This calculation is to get the first day of the month of the calendar date that the accounting transaction falls in. e.g. 01/mm/yyyy
The DAX I have is:
Transaction Date = VAR vLyEndMonth = MONTH(MAX(Company[NextYearEnd])) VAR vLyEndYear = YEAR(MAX(Company[NextYearEnd])) VAR vTranMM = MONTH(SELECTEDVALUE(NlTransactionSummary[mm])) VAR vTranYY = YEAR(SELECTEDVALUE(NlTransactionSummary[YY])) VAR vYeMM = IF(vLyEndMonth + vTranMM > 12, vLyEndMonth - 12, vLyEndMonth) VAR vYeYY = IF(vLyEndMonth + vTranMM > 12, vLyEndYear - 1, vLyEndYear) VAR vYeDate = "01" & "/" & vYeMM & "/" & vYeYY RETURN vYeDate
The issue is with the month part of the date is not formatting properly. I am getting, for example, -9 for September instead of 09.
Any help greatly appreciated.