Forum Discussion
Keeping data based on export date and unique occurrences
Hello everyone,
I have to create a report via Power Query which has a technical difficulty that I seem incapable to work around. The ERP we use flushes data more than 6 months old, so for example when I export data in 12/22, everything before 06/22 is not reachable.
The data structure I have is, oversimplified of course, as follows:
| EXPORT DATE | Anomaly ID |
| 31/01/2022 | A |
| 31/01/2022 | B |
| 31/01/2022 | C |
| 28/02/2022 | A |
| 28/02/2022 | C |
| 31/12/2022 | D |
| 31/12/2022 | E |
In the example above:
- The anomaly "B" has been fixed since the 01/22 export
- The anomalies "A" and "C" still exist in the 02/22 export because they have not been fixed
- The anomalies "A" and "C" do not appear in the 12/22 export because they have been flushed by the ERP, even if they still exist.
What I need to have at the end of the year is (data is exported on a monthly basis) :
| Anomaly ID |
| A |
| C |
| D |
| E |
Thanks in advance for any help!
4 Replies
- Vijay_A_VermaMost Valuable Professional
By your logic, anomalies A & C wouldn't appear as they will be flushed out because of 6 months logic. Then output will be only
D
E
- AnonymousNot applicable
Hi Spigaw ,
Is there a Flag column that show each anomalies 's status(fixed or flushed )?
As Vijay_A_Verma said, based on the logic you described, the output should be D and E only.
Please kindly refer to
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- SpigawHelper III
We have no way of tagging the anomalies. I'll try to find a manual way to fix this, thanks for your help!
- AnonymousNot applicable