Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
Found a formula at daxpattern for the previous month date
PM Date =
CALCULATE (
MAX ( D_Date[DATE_Date] ),
ALL ( D_Date ),
FILTER (
ALL ( D_Date[DATE_DayNumberInMonth] ),
D_Date[DATE_DayNumberInMonth] <= EARLIER ( D_Date[DATE_DayNumberInMonth] )
|| EARLIER(D_Date[DATE_DayNumberInMonth] ) = EARLIER ( D_Date[DaysInMonth] )
),
FILTER (
ALL ( D_Date[DATE_MonthNumber] ),
D_Date[DATE_MonthNumber]
= EARLIER ( D_Date[DATE_MonthNumber] ) - 1
)
)
but
for some reasons formula return date from the next year instead of current.
day numer and month name is correct.
Why year is a different ?
Hi @slyfox
could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @slyfox,
Based on my test, you could try this dax formula:
PM = DATE(YEAR('D-Date'[date]),MONTH('D-Date'[date])-1,DAY('D-Date'[date]))
Result:
Regards,
Daniel He
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |