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

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.

Reply
Anonymous
Not applicable

dax: how to delete records based from other table

Hi,

 

So i have this kind of report called enrollment report, with columns: Name.ID, GU, Coutry, Number

 

Then i have another 2 reports called ToberemovedfromSA and ToberemovedfromIN both with only name.id column

 

using dax, i would like to remove those ids in SA and IN reports from my enrollment report. All reports are in excel.

 

I tried this, 

 

SA Removed = CALCULATETABLE('Enrollment Report',EXCEPT(VALUES('Enrollment Report'[Name.id],VALUES('ToberemovedSA'[name.id]))))

 

But i am getting this error : "Too many arguments were passed to the VALUES function. The maximum argument count for the function is 1."

 

How do i fix this?

 

Thank you.

 

Riri

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Maggie,

 

Thank you!  

 

Here's what i did in the Query Editor as a workaround:

1. i appended my SA table to IN table

2. then i merged them to my enrolment report using the Left Outer

3. then filter out those that matched

 

I got a different output using your measure from what i did, or maybe there is something that i missed. i'll try your measure again and let you know 🙂

 

 

 

 

View solution in original post

7 REPLIES 7
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Create relationship as below

14.png

 

Create measure in table "enrollment report"

Measure = IF(MAX('enrollment report'[Name.ID])<>MAX('IN'[id])&&MAX('enrollment report'[Name.ID])<>MAX('SA'[id]),1,0)

15.png

 

Best Regards
Maggie



Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

Hi Maggie,

 

Thank you!  

 

Here's what i did in the Query Editor as a workaround:

1. i appended my SA table to IN table

2. then i merged them to my enrolment report using the Left Outer

3. then filter out those that matched

 

I got a different output using your measure from what i did, or maybe there is something that i missed. i'll try your measure again and let you know 🙂

 

 

 

 

Hi @Anonymous

Based on my experience, your method should be also possible.

If you have any problem, please feel free to let me know.

 

Best Regards

Maggie

 

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlB
Super User
Super User

Hi @Anonymous

 

The error is caused by a missing closing parenthesis for the first VALUES(). You also had one too many closing parenthesis at the very end. This should eliminate that error.  I haven't looked further than that

 

SA Removed =
CALCULATETABLE (
    'Enrollment Report',
    EXCEPT (
        VALUES ( 'Enrollment Report'[Name.id] ),
        VALUES ( 'ToberemovedSA'[name.id] )
    )
)
Anonymous
Not applicable

Hi @AlB,

 

Thanks! I totally missed that. but i got new error

                     "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

do they have to have the same number of columns?

@Anonymous

 

What is 'SA Removed'?  A measure? It needs to be a calculated table. Measures only return scalars

Hi @Anonymous,

 

could you provide data samples? It makes easier to find a solution if we know what your data looks like.

 

regards,

Sturla

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.