Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply

DAX table with filters and operators

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"

),

 

3 REPLIES 3
Anonymous
Not applicable

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.

gadielsolis
Resolver III
Resolver III

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:

MichaelHutchens_0-1705519789912.png

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.