Forum Discussion
Anonymous
6 years agoNot applicable
DAX HELP
I want a column for showing day of last month. But dax is showing data in a different way. CURRDAYPREVMONTH = DATE(YEAR(ACX_Dates[Date]), MONTH(ACX_Dates[Date])-1, DAY(ACX_Dates[Date])) ACT...
- 6 years agoHacky, but you could always do this:
Column 2 =
IF(DAY([REPORTDATE]) > DAY(EOMONTH([REPORTDATE],-1)),
DATE(YEAR([REPORTDATE]),MONTH([REPORTDATE])-1,DAY(EOMONTH([REPORTDATE],-1))),
DATE(YEAR([REPORTDATE]),MONTH([REPORTDATE])-1,DAY([REPORTDATE]))
)
amitchandak
Super User
6 years agoAnonymous
Try like
new column = dateadd([REPORTDATE],-1,month)
Or
new column =date(year([REPORTDATE]),month([REPORTDATE])-1,day([REPORTDATE]))
Anonymous
6 years agoNot applicable
Already used this same formula, result is different.
- Greg_Deckler6 years ago
Community Champion
Hacky, but you could always do this:
Column 2 =
IF(DAY([REPORTDATE]) > DAY(EOMONTH([REPORTDATE],-1)),
DATE(YEAR([REPORTDATE]),MONTH([REPORTDATE])-1,DAY(EOMONTH([REPORTDATE],-1))),
DATE(YEAR([REPORTDATE]),MONTH([REPORTDATE])-1,DAY([REPORTDATE]))
)- Anonymous6 years agoNot applicable
Thanks a lot Greg. It worked for me.
I need one more help
I want to calculate current Fiscal Year End Date (April - March)
Suppose for Today, Fiscal year end date should be 31-03-2021