Forum Discussion
Anonymous
5 years agoNot applicable
Display dates
I have a column year-mon That contains data like: 2021-02 2021-03 2021-01 How can display a calculated column like: 2021-02-28 2021-03-31 2021-01-31 For the current month, I need to display ...
- 5 years ago
Hey Anonymous ,
in DAX it's also possible.
Add a calculated column with the following code:
EndOfMonth = VAR vYEAR = LEFT( MyTable[year-mon], 4 ) VAR vMonth = RIGHT( MyTable[year-mon], 2 ) VAR vDateFirst = DATE( vYEAR, vMonth, 1 ) RETURN EOMONTH( vDateFirst, 0 )Let me know if that worked.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.bi
Anonymous
5 years agoNot applicable
Hi selimovd I need to do it within Dax in power bi.
selimovd
5 years agoMost Valuable Professional
Hey Anonymous ,
in DAX it's also possible.
Add a calculated column with the following code:
EndOfMonth =
VAR vYEAR = LEFT( MyTable[year-mon], 4 )
VAR vMonth = RIGHT( MyTable[year-mon], 2 )
VAR vDateFirst = DATE( vYEAR, vMonth, 1 )
RETURN
EOMONTH( vDateFirst, 0 )
Let me know if that worked.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi