Hi, I'm ultimately trying to create MTD, QTD, and YTD calculations in Power BI Desktop using DAX and I'm stuck on the 'pre-step' of converting my date data (TrnYear and TrnMonth, see img) from Whole Numbers to Date values. I tried the DATE and DATEVALUE expressions and did not get the correct solution.
This expression:
Year = DATEVALUE(InvMovements[TrnYear])
Results in this error:
Cannot convert value '2016' of type Text to type Date.
DATE is not working becasue it wants more arguments, but I just want the year
Year = DATE(InvMovements[TrnYear])
Results in this error:
Too few arguments were passed to the DATE function. The minimum argument count for the function is 3.
Another expression I used didn't throw an error but returned '1905' as the date value for the TrnYear value '2016'.
Any help would be very much appreciated!