Creat a new column to delete duplicate row based on multiple condition
We need help to create a dax formule.
We have a calculated table which have the following columns (Training, Email, Date, Statut, Source)
For one person, he could do the training in serveral applications (LWL, CHINA, PROOFPOINT). But the key of this table should be Training and Email. Based on the data from the different source (LWL, CHINA ou PROOFPOINT) and Statut (DONE, NOT DONE) we delete the row.
So the aim is to create a new column to decide which row should be deleted (the value of this field will be "DELETED" ou "KEPT")
if the source is "LWL" and Statut is "NOT DONE " while another row has the source as "CHINA" and Statut as "DONE", in this case, the one has "LWL APP" and "NOT DONE" should be deleted for the same email and training.
If the source is "LWL APP" and Statut is "DONE" while another row with the source as "CHINA" and Statut as "DONE", then the one which has "CHINA" and Statut as "DONE" should be deleted.
And in this table, there is already a calculated column CheckDuplicateData to know the rows which have the duplicated rows based on eamil and trainingid.
Howerver it seems not the resultat which I am waiting for. I added your formule in the measure _M_SOURCE_DELEE. for the sessionID 764, it is correct. CHINA should be deleted and LWL APP should be kept. But for the sessionID 233, LWL APP should be deleted and CHINA should be kept as it is "LWL APP" who is not done (M_DONE_OU_PAS).