Forum Discussion

Mooihoek's avatar
Mooihoek
Icon for Helper II rankHelper II
8 years ago
Solved

Power BI Remove Duplcates based on measure value

I want to be able to remove some duplicate account numbers based on whether the account has expired or not.  I'm using the following measure to identify whether the acccount has expired in a table based in the account expiry date.

 

e.g. Account Expiry = DATEDIFF(TODAY(),MAX('Table1'[Account End Date]),DAY), this gives me a value in the Account Expiry Day column, I then want to remove 

 

As you can see by the below table, Account 2 appears twice, but only one is valid, e.g it has 10 days remaining (the other expired 35 days ago) . How can I remove the duplicates accounts which have expired?

 

Sales Account NameAccount Expiry (DaysAcount ExpiryAccount ID
Account 1-501/02/20181234
Account 2-351/05/201812345
Account 3-51/07/2018123456
Account 2101/08/201812345
Account 5151/09/201812345678
Account 6201/10/2018123456789

 

 

8 Replies