Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 63 | |
| 55 | |
| 42 | |
| 41 | |
| 23 |
| User | Count |
|---|---|
| 165 | |
| 132 | |
| 118 | |
| 79 | |
| 53 |