Forum Discussion
how to compute this column based on condition
Hello, i have some data below and i want to calculate a specific column (last one) by folder:
| Folder_id | Status | Date | Time between two dates by Id |
| 1000 | Generated | 01/01/2022 | |
| 1000 (same folder signed then calculate) | Signed | 04/01/2022 | Signed - Generated |
| 300 | Generated | 03/02/2022 | None |
| 420 | Generated | 05/02/2022 | None |
I already computed the third column, but i couldn't find a way to do that as sometimes we can have 2 lines with signed per id and i want it to take the last one (bc it's probably an error).
thanks
3 Replies
- Idrissshatila
Super User
Hello,
you could add an index column so every row will have a seperate ID that you could work with.
You could refer to this article inorder to see how to add an index column https://learn.microsoft.com/en-us/power-query/add-index-column
If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍
- AnonymousNot applicable
Sorry but this doesn't answer to my probleme. I want to compute the column not to add a unique id
- speedramps
Super User
Please can you provide example input data as a table, and the desired output with a very clear step by step explanation of what you want. The more effort you put into a clear description, the quicker and better replies you will receive. I think all the super users want to help you, but we are really struggling to understand you vague desription. Consider asking your manager to help write the explanation.
If you have a table or records which includes a date column with duplicated dates and you just want the most recent record for each date then try this ...Use power queryGet dataAdd an index columnCreate 2 reference tables of the originalGroup the first reference table by date with max index.Then inner join with 2nd reference by index. Just keeping matching rows.Voila! You now have the table with the last record for each date.