This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I have a table like this now.
| Car ID | Task ID | Type | Start time | Finish time |
| Car A | 123 | S | 14/7/2022 10:00:00 | 14/7/2022 10:00:01 |
| Car A | 124 | T | 14/7/2022 10:00:01 | 14/7/2022 10:01:00 |
| Car A | 124 | T | 14/7/2022 10:00:02 | 14/7/2022 10:01:05 |
| Car A | 125 | S | 14/7/2022 10:01:07 | 14/7/2022 10:01:10 |
| Car A | 126 | S | 14/7/2022 10:01:13 | 14/7/2022 10:01:13 |
| Car B | 234 | T | 14/7/2022 09:02:00 | 14/7/2022 09:02:10 |
| Car B | 234 | T | 14/7/2022 09:01:59 | 14/7/2022 09:02:10 |
| Car B | 235 | S | 14/7/2022 09:02:06 | 14/7/2022 09:02:20 |
| Car B | 236 | S | 14/7/2022 09:02:19 | 14/7/2022 09:02:30 |
I am wondering what is the difference between the following two expressions.
Expression 1:
vMaxPrevTaskFinish =
VAR vThisTaskID = CarTasks[Task ID]
return
CALCULATE (
MAX ( CarTasks[Finish time] ),
ALLEXCEPT ( CarTasks, CarTasks[Car ID] ),
CarTasks[Task ID] < vThisTaskID
)
Expression 2:
_vMaxPrevTaskFinish =
VAR vThisTaskID = CarTasks[Task ID]
return
CALCULATE (
MAX ( CarTasks[Finish time] ),
ALLEXCEPT ( CarTasks, CarTasks[Car ID] ),
FILTER(CarTasks,CarTasks[Task ID] < vThisTaskID)
)
Result:
Leading to different results.
The only difference is whether putting a FILTER function onto the "Task ID". In my mind, they are just doing the same thing as both of them are to "filter" something by passing a condition statement to the CALCULATE function.
Can someone explain to me what is the difference between them?
Solved! Go to Solution.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 28 | |
| 28 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 34 | |
| 25 | |
| 24 |