I have a file with 2 columns - Month, Year. The month column is the text name for the month. I would like to create a custom column that will create a date using the month & year columns and the day will be the last day of the month.
EXAMPLE of current file:
MONTH YEAR
October 2010
I would like this to read 10/31/2010 in the new column.
Any help is greatly appreciated.
Solved! Go to Solution.
If you want to try DAX, you can create two columns to get the values
Date_Start = DATEVALUE('Tran'[Year]&"/"&'Tran'[Month]&"/"&"1")
Date_End = EOMONTH('Tran'[Date_Start],0)
Remember to change the data type to Date
If you want to try DAX, you can create two columns to get the values
Date_Start = DATEVALUE('Tran'[Year]&"/"&'Tran'[Month]&"/"&"1")
Date_End = EOMONTH('Tran'[Date_Start],0)
Remember to change the data type to Date
Hi @dadelta50,
By my tests, the M query of ImkeF should solve your problem.
If you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
Best Regards,
Cherry
Create a new column that returns a text string with a full date expression with this formula:
"1."&[Month] &"."&Text.From([Year])
Then just convert this column to date.
If you want to retrieve the last date within the month, you can instead use this formula:
Date.EndOfMonth( Date.From( "1." & [Month] & "." & Text.From([Year]))))
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
User | Count |
---|---|
118 | |
63 | |
61 | |
41 | |
40 |
User | Count |
---|---|
118 | |
67 | |
65 | |
64 | |
50 |