Forum Discussion
Power Query - Most Recent File within a week
I decided to create a new column called "merged" with power query, which combines the "group name", "category", "year", "week of year".
For example:
A,inside,2022,48
A,inside,2022,48
A,outside,2022,48
B,inside,2022,48
B,outside,2022,48
B,outside,2022,48
This enables me to quickly see which items have duplicate files on the same weeks. I then created an "Age" column that shows the amount of days after the file was created.
| Merged | Age |
| A,inside,2022,48 | 6.00:00:00 |
| A,inside,2022,48 | 7.00:00:00 |
| A,outside,2022,48 | 7.00:00:00 |
| B,inside,2022,48 | 7.00:00:00 |
| B,outside,2022,48 | 6.00:00:00 |
| B,outside,2022,48 | 7.00:00:00 |
With the previous table additions, I believe I can use the combination of Age and Merged columns to filter out the older erroneous data. Is that possible? Is that a measure, or some other query? I'm not sure how to actually use this data to use the most recent file for a given category, week, year, team.
Hi v-zhangti
I am trying to understand the measure you wrote, but recreate it for what I have built.