Forum Discussion
indicator for duplicate values from 2 tables
- 1 year ago
Hi Sander1401 ,
Yes, you can create an indicator for this. The best approach is to add a calculated column to your appended table using a DAX formula. This new column will check each row and place a "Duplicate" flag on any row from tabel2 where the customernr also exists in tabel1.
To create this column, go to the Data View in Power BI, select your appended table, and click New column. Then, enter the following DAX formula. This formula first checks if a row is from tabel2 and if its customernr is present in the set of customer numbers belonging to tabel1. It will then label the row accordingly.
Duplicate Indicator = VAR isFromTable2 = 'Appended Table'[Tabel] = "tabel2" VAR currentCustomer = 'Appended Table'[customernr] VAR isInTable1 = CONTAINS( FILTER('Appended Table', 'Appended Table'[Tabel] = "tabel1"), 'Appended Table'[customernr], currentCustomer ) RETURN IF(isFromTable2 && isInTable1, "Duplicate", "Unique")Once you've created the Duplicate Indicator column, you can easily build your graphs. For your first graph showing results from tabel1, simply filter the visual where the Tabel column is "tabel1". For your second graph showing the unique results from tabel2, apply two filters to the visual: filter the Tabel column to "tabel2" and filter your new Duplicate Indicator column to "Unique". This will exclude the customer numbers shared with tabel1.
Best regards,
Hi Sander1401 ,
Yes, you can create an indicator for this. The best approach is to add a calculated column to your appended table using a DAX formula. This new column will check each row and place a "Duplicate" flag on any row from tabel2 where the customernr also exists in tabel1.
To create this column, go to the Data View in Power BI, select your appended table, and click New column. Then, enter the following DAX formula. This formula first checks if a row is from tabel2 and if its customernr is present in the set of customer numbers belonging to tabel1. It will then label the row accordingly.
Duplicate Indicator =
VAR isFromTable2 = 'Appended Table'[Tabel] = "tabel2"
VAR currentCustomer = 'Appended Table'[customernr]
VAR isInTable1 =
CONTAINS(
FILTER('Appended Table', 'Appended Table'[Tabel] = "tabel1"),
'Appended Table'[customernr], currentCustomer
)
RETURN
IF(isFromTable2 && isInTable1, "Duplicate", "Unique")
Once you've created the Duplicate Indicator column, you can easily build your graphs. For your first graph showing results from tabel1, simply filter the visual where the Tabel column is "tabel1". For your second graph showing the unique results from tabel2, apply two filters to the visual: filter the Tabel column to "tabel2" and filter your new Duplicate Indicator column to "Unique". This will exclude the customer numbers shared with tabel1.
Best regards,