Forum Discussion
Checking if right code was deleted
Not sure if my understanding is correct.
For ID A, the data should be compared with column 2 in table2, if the data exist in column2, then it should be deleted. such as 22222
For ID B, the data should be compared with column 1 in table2,if the data exist in column1,then it should be deleted. such as 44444
If the above logic is correct, you might refer to my below measure:
Measure =
SWITCH(SELECTEDVALUE('Table'[ID]),"A",IF(SELECTEDVALUE('Table'[Data]) in VALUES('Table (2)'[Column2]),BLANK(),MAX('Table'[Data])),"B",IF(SELECTEDVALUE('Table'[Data]) in VALUES('Table (2)'[Column1]),BLANK(),MAX('Table'[Data])
))
Pbix attached.
v-diye-msft thanks!
So the data needs to look at both columns. You want to see if an ID has the combination of codes (column & column 2), and if it does, its deleting the column 2 code, not the column 1 code. Hope that makes sense.
- v-diye-msft6 years agoCommunity Support
Do you mean if there's ID has the codes from both column 1 and column 2, then delete the one in column2?
But why you delete the 44444 in this description below? it's from column1.
" However, the next example is not right. ID B has codes 44444 and 11111. But instead of code 11111 being deleted, code 44444 was deleted. "
- PowerBI1234566 years agoPost Partisan
v-diye-msft Sorry, should have been more clear. That would be a finding/exception. I am trying to find instances where the wrong code was deleted. Hope that makes sense. Thanks!
- PowerBI1234566 years agoPost Partisan
Hi - just seeing if anyone had any ideas, thanks again!