Comparing for allowable items

uceaamh

New Member
Joined
Feb 23, 2017
Messages
27
Good afternoon,

I am attempting to identify mismatched data in Power BI. However, I am totally new to BI and am intimidated by DAX.
I have two tables:
Table 1 is a list of business IDs, and what item types they are allowed to interact with
Table 2 is a list of business IDs, and what items they have interacted with

They look like:
Table 1
Business ID:Allowable Interactions:
1Car
1Toy
1TV
1Sweater
2Car
2Toy
3Car
3Oil
3Table
3Awning
3Sweater
3Key
3Corn
4Oil
4Sweater

<tbody>
</tbody>

Table 2
Business ID:Items interacted with:
1Car
1Car
1Oil
1TV
1Car
2Car
2Toy
2Toy
3Car
3Oil
3Table
3Table
3Awning
3Car
3Oil
4Oil
4Sweater

<tbody>
</tbody>

My end goal is to be able to filter out any rows where the interactions are valid. I only want to see the rows where a business has interacted with items they are not allowed to interact with.

Those two tables are created from 4 data sources:

List of Business IDs/Item Interactions
List of Unique Business IDs
List of Business IDs/Allowed Items
List of Unique Items

With relationships between:

Unique Items > List of Business IDs/Allowed Items & Unique Items > List of Business IDs/Item Interactions
Unique Business IDs>List of Business IDs/Item Interactions & List of Unique Business IDs>List of Business IDs/Allowed Items

Hoping there's an easy solution. Thanks for reading this far!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
The easy solution is to do an anti join in Power Query.

Get the two tables ready, chose Merge Queries as New, select the two table and the two columns in each to merge on (Ctrl Click), Join Kind choose left anti.
 
Upvote 0
After watching a few videos on DAX and some reading, I was able to develop a solution (I believe).
Posted here for anyone else who may need it:
New Measure:

Code:
Allowable interaction = sumx( CROSSJOIN('Table1','Table2'),('Table2'[Item ID]='Table 1'[Item ID])*('Table 2'[Business ID]='Table 1'[Business ID])*1)
 
Last edited:
Upvote 0
I agree qith gazpahge, Power Query is the way to go. It is a data clean-up, so PQ is the solution. Just load the two tables into PQ, add a custom column concatenating the id and interaction in each, do a merge query with an anti-join right (assuming actual interactions are right), and it is all done.
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,981
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top