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 all,
I have a table like this:
Boat Date Status
A 15/07/2020 2
A 16/07/2020 1
A 17/07/2020 2
B 15/07/2020 1
B 16/07/2020 2
B 17/07/2020 1
How can I add a new calculated column showing in each row the status of the same boat in the previous day, showing as follows:
Boat Date Status Status Day Before
A 15/07/2020 2 -
A 16/07/2020 1 2
A 17/07/2020 2 1
B 15/07/2020 1 -
B 16/07/2020 2 1
B 17/07/2020 1 2
Thanks!
Solved! Go to Solution.
@planning - Try:
Status Day Before =
VAR __DayBefore = MAXX(FILTER('Table',[Date] = EARLIER('Table'[Date]) - 1 && [Boat] = EARLIER('Table'[Boat])),[Status])
RETURN
__DayBefore
@planning - Try:
Status Day Before =
VAR __DayBefore = MAXX(FILTER('Table',[Date] = EARLIER('Table'[Date]) - 1 && [Boat] = EARLIER('Table'[Boat])),[Status])
RETURN
__DayBefore
@planning , As new column
//continous day
Last day value = maxx(filter(Table, [date] = earlier([date]) -1 && [Boat] = earlier([Boat])),[Status])
// noncontinous day
Last day value =
var _max = maxx(filter(Table, [date] < earlier([date]) && [Boat] = earlier([Boat])),[date])
return
maxx(filter(Table, [date] = _max && [Boat] = earlier([Boat])),[Status])
for measure for same case find measure here
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |