Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
105 | |
88 | |
75 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |