Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a table that has entries like
AcctNum Code Answer DateTime
123456 Start1 1503 3/25/19 4:27PM
123456 End1 1752 3/25/19 8:55PM
123456 Start1 1510 3/25/19 5:15PM
I want to keep the row for each code/acctnum with the last datetime entry
In the above example it would only keep the last two rows.
Solved! Go to Solution.
I was able to get what I need creating a new table and then pulling the latest answer for each field name. I couldn't get anything else to work. I appreciate all the help tho. So many great ideas I will be using for other things.
Hi @kattlees ,
Based on my test, you could refer to below steps:
Add index for your data in query editor:
Apply it and use the Top N filter for your data table:
Regards,
Daniel He
Thanks for this, but I need to do it in the power query because I then pivot the table so each code has it's own column with just the latest value.
Hi @kattlees ,
You could refer to below link to use Keep rows function:
https://community.powerbi.com/t5/Desktop/Top-N-query-with-direct-query/td-p/236401
Regards,
Daniel He
Hey,
can you please explain the rule.why you just want to keep the last two rows?
Regards,
Tom
Our system saves a row each time a new entry is added for each code. So on one form, there could be 5 entries for the same code and account. The only one I care about is the last one entered.
I was able to get what I need creating a new table and then pulling the latest answer for each field name. I couldn't get anything else to work. I appreciate all the help tho. So many great ideas I will be using for other things.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |