Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi everyone, I'm trying to make a virtual table from an 'Employee' database that returns a list of employees. Each employee in the database might have multiple records, so in this virtual table, I only want the latest record with the highest record number, based on the 'Employee ID' field. I also only want records where the 'Current Employee Email Record' field = 'Y' OR the 'Employee Status' field = 'Withdrawn'.
So the logic should be = [Highest record number] AND ([Current Employee Email Record] OR [Employee Status])
I've given it a go with the table below, but I'm getting an error:
"Too few arguments were passed to the FILTER function. The minimum argument count for the function is 2."
Can anyone suggest where I'm going wrong? 🙂
Table 4 =
FILTER(
ADDCOLUMNS(
'Employee',
"R", RANKX (
FILTER(
'Employee',
'Employee'[Email Address] =EARLIER ('Employee'[Email Address])), 'Employee'[Employee ID], , DESC) && 'Employee' [Current Employee Email Record] = "Y" || 'Employee' [Employee Status] = "Withdrawn"
),
Hi @MichaelHutchens ,
Please try this DAX:
Table 4 =
VAR EmployeeLatestRecord =
ADDCOLUMNS(
GROUPBY(
'Employee',
'Employee'[Employee ID],
"MaxRecordNumber", MAXX(CURRENTGROUP(), 'Employee'[Record Number])
),
"EmployeeDetails", CALCULATETABLE(
'Employee',
FILTER(
'Employee',
'Employee'[Record Number] = [MaxRecordNumber]
)
)
)
RETURN
FILTER(
EXPANDTABLECOLUMN(EmployeeLatestRecord, "EmployeeDetails"),
'Employee'[Current Employee Email Record] = "Y" || 'Employee'[Employee Status] = "Withdrawn"
)
I'm not sure this is useful, if it doesn't solve your problem, please provide some sample data, thanks!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please try the following:
FILTER(
ADDCOLUMNS(
'Employee',
"R", RANKX (
FILTER(
'Employee',
'Employee'[Email Address] =EARLIER ('Employee'[Email Address])), 'Employee'[Employee ID], , DESC) ,
'Employee' [Current Employee Email Record] = "Y" || 'Employee' [Employee Status] = "Withdrawn"
)
EDIT: I'd replied to your first post, not the correction
Thanks @gadielsolis , but I'm getting an error with that code:
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 19 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 39 | |
| 31 | |
| 27 |