Forum Discussion
Nagababu
1 year agoNew Member
Merging column
Hi Team, I have a requirement for merging, and I've tried a couple of approaches, but they haven't met the expected output. Could someone please assist me with this requirement? Customer Employee...
BIswajit_Das
Impactful Individual
1 year agoHello Nagababu
As you've mentioned above result table;
i.e
expecting out put is below wise
| customer_employee_id | theatro_employee_id | first_name | last_name | MergeFlag |
| 1 | 101 | John | Doe | 1 |
| 1 | 102 | John | Doe | 1 |
| 1 | 103 | Spin | george | 103 |
| 1 | 104 | Jane | Doe | 1 |
| 1 | 105 | Mary | Doe | 105 |
| 1 | 106 | John | Smith | 106 |
| 1 | 107 | John | Doe | 1 |
| 1 | 108 | John | Doe | 1 |
| 2 | 109 | Jane | Smith | 109 |
| 3 | 110 | John | Doe | 110 |
Have doubt in the row
| customer_employee_id | theatro_employee_id | first_name | last_name | MergeFlag |
| 1 | 104 | Jane | Doe | 1 |
the MergeFlag value here should be 1 or 104
If it's 104 then here's the DAX for creating a calculated column which return your required result
i.e
MergeFlag =
VAR _rows =
COUNTROWS(
FILTER('TABLE',
'TABLE'[customer_employee_id] = EARLIER('TABLE'[customer_employee_id]) &&
'TABLE'[first_name] = EARLIER('TABLE'[first_name]) &&
'TABLE'[last_name] = EARLIER('TABLE'[last_name])
)
)
RETURN
IF(_rows > 1, 'TABLE'[customer_employee_id] , 'TABLE'[theatro_employee_id])
But if it's 1 then need more data for better understanding.
Thanks & Regards...