Forum Discussion
ntaylo06
7 years agoResolver II
Getting Data From Previous Row Based On Two Criteria
I have have the table 'Data' with the fields 'employee ID', 'rotation number', and 'location' with each employee ID appearing three times with rotation number increasing each time and a location code...
ntaylo06
7 years agoResolver II
HotChilli wrote:Is the last value in 'last location' a mistake? Should it be uvwx?
Yes, that was a mistake. I've fixed it now.
HotChilli wrote:If so, try adding a column
The column kinda works, but it is only pulling the entry for rotation #2 and then displaying it for all rows after the first:
+---------------+-------------------+------------+-----------------+ | employee ID | rotation number | location | last location | +---------------+-------------------+------------+-----------------+
1001 1 abcde xxxxx 1001 2 fghij abcde 1001 3 klmno abcde 1002 1 pqrst xxxxx 1002 2 uvwx pqrst 1002 3 yzab pqrst
HotChilli
7 years agoCommunity Champion
Do you want to link your pbix here and i'll have a look at it?
- ntaylo067 years agoResolver II
HotChilli Thats alright, I found a workaround solution by adding an index column and then calculating index-1 from it. Thanks for trying, though.
- v-chuncz-msft7 years agoCommunity Support
Glad to hear that. You may help accept the solution above. Your contribution is highly appreciated.