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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
nimeshshah
Frequent Visitor

Difference between two list of values

Hi,

 

I am trying to add a new column to the table below which would have the list of codes which are in column "Codes on Card" but not in the column "Codes in System".

 

 

ss1.jpg

 

 

 

 

 

 

I tried using the List.Difference function but it gives this error

 

 

ss2.jpg

 

 

 

 

 

 

 

This table has approx. million rows.

 

Can someone please let me know if there is any other option in Power Query or DAX to achieve this? 

 

 

Thanks,

Nimesh

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@nimeshshah ,

 

You can split the text values in "Codes on Card" and "Codes in System" and then unpivot these new columns, then remove useless columns and rename some column like below:

Capture.PNG 

 

Duplicate the table and filter based on attribute column in two tables you will get two tables as below:

Table1

1.PNG 

 

#"Table1 (2)"

2.PNG

 

In final, create a blank query using M code: 

let
    Source = List.Difference(Table1[Value], #"Table1 (2)"[Value])
in
    Source

3.PNG 

 

You may also refer to the appendix as well.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@nimeshshah ,

 

You can split the text values in "Codes on Card" and "Codes in System" and then unpivot these new columns, then remove useless columns and rename some column like below:

Capture.PNG 

 

Duplicate the table and filter based on attribute column in two tables you will get two tables as below:

Table1

1.PNG 

 

#"Table1 (2)"

2.PNG

 

In final, create a blank query using M code: 

let
    Source = List.Difference(Table1[Value], #"Table1 (2)"[Value])
in
    Source

3.PNG 

 

You may also refer to the appendix as well.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thanks for the response. This worked perfectly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors