Forum Discussion
Checking if right code was deleted
Hi - just seeing if anyone had any ideas, thanks again!
A little confused on your scenario but I think this does what you are looking for. Assuming you have a relationship between the Data column and Column1 of your second table, you can make a Calculated Column with this expression to identify missed deletions.
Missed Deletion =
VAR __badcode =
IF ( Codes[Item] = "Code1", RELATED ( BadCombos[Column2] ) )
RETURN
IF (
CALCULATE (
COUNTROWS ( Codes ),
ALLEXCEPT ( Codes, Codes[ID] ),
Codes[Data] = __badcode,
Codes[Item] <> "Code1"
) > 0,
"Missed Deletion"
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- PowerBI1234566 years agoPost Partisan
mahoneypat thanks!! Where does your code take into account the column 1 codes, and why does code item="code 1"?
- mahoneypat6 years agoMicrosoft Employee
The column 1 codes are taken into account through the relationship. Also, I saw in the first example rows had Code1 in the first value and for the deletion, and then Code2 for the new/correct one. I assumed (perhaps incorrectly) that it was a typo on the second set of example rows did not have 1 or 2 next to the codes. Please confirm my assumption was incorrect, and I can propose a different measure.
Regards,
Pat
- PowerBI1234566 years agoPost Partisan
mahoneypat Thanks! Forgot to mention it will be a many to many relationship if I do it that way. See below.