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.
Just to build on what @marcster_uk sent , here are some pre-defined time format
āGeneral Dateā -
Displays a date and/or time. For example, 3/12/2008 11:07:31 AM. Date display is determined by your applicationās current culture value.
āLong Dateā or āMedium Dateā -
Displays a date according to your current cultureās long date format. For example, Wednesday, March 12, 2008.
āShort Dateā -
Displays a date using your current cultureās short date format. For example, 3/12/2008.
āLong Timeā -
Displays a time using your current cultureās long time format; typically includes hours, minutes, seconds. For example, 11:07:31 AM.
āMedium Timeā -
Displays a time in 12 hour format. For example, 11:07 AM.
āShort Timeā -
Displays a time in 24 hour format. For example, 11:07.
Hi @PaulBoyes, weāve noticed that no response has been received from you since the 23rd of May. We just want to check if you still need further help with this post? In case there wonāt be any activity on it in the next few days, weāll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!