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.
Hi,
I am struggling with the following. I want to create a new column, in which I want to show the value (column 3 "Anzahl Lieferungen") from last year's date (column 1 "Datum Auswertung" - 1 year) considering the value in column B ("Route", eg. Seefracht, Kurier, Luftfracht). Which formula must I use in DAX to do that?
Solved! Go to Solution.
Hi @dirkkoch
Use EDATE([date column], -12) function to get the same date in last year. This would not have that problem. For leap years, it will get last year's Feb 28th's value for this leap year's Feb 29th.
calculatedColumn =
MAXX (
FILTER (
t1,
t1[Route] = EARLIER ( t1[Route] )
&& t1[Datum Auswertung] = EDATE ( EARLIER ( t1[Datum Auswertung] ), -12 )
),
t1[Anzahl Lieferungen]
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
@dirkkoch can you please provide some sample data and desired output for those candidates?
calculatedColumn=MAXX(filter(t1,t1[Route]=earlier(t1[Route])&&t1[Datum Auswertung]=earlier(t1[Datum Auswertung])-365),t1[Anzahl Lieferungen])
@smpa01 thank you for the support. This works fine. Since there are also leap years with 366 days a year. How can I take care of this without having to manually adjust?
Hi @dirkkoch
Use EDATE([date column], -12) function to get the same date in last year. This would not have that problem. For leap years, it will get last year's Feb 28th's value for this leap year's Feb 29th.
calculatedColumn =
MAXX (
FILTER (
t1,
t1[Route] = EARLIER ( t1[Route] )
&& t1[Datum Auswertung] = EDATE ( EARLIER ( t1[Datum Auswertung] ), -12 )
),
t1[Anzahl Lieferungen]
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |