Forum Discussion
Pquinlan21
2 years agoFrequent Visitor
undefined
Hi, I am trying to get the previous timestamp value in each column so I can calculate the change over the previous hour. I have attached a screen shot of the columns. Each row of data is pulled on an...
Pquinlan21
2 years agoFrequent Visitor
Hi, this is the error I got back. Thank you for the help
- AlexisOlson2 years agoSuper User
Sorry, that image is too tiny to be readable. Can you share the text of the error message?
- Pquinlan212 years agoFrequent Visitor
OFFSET' Relation parameter may have duplicate rows. This is not allowed.
- AlexisOlson2 years agoSuper User
Ah, I have seen this before.
Try adding MATCHBY as explained in great detail here:
https://pbidax.wordpress.com/2023/05/25/introducing-matchby-for-dax-window-functions/Prev_tsCST = SELECTCOLUMNS ( OFFSET ( -1, TableName, ORDERBY ( TableName[tsCST], ASC ), MATCHBY ( TableName[tsCST] ) ), "Prev_BHCC_WQ159914B_OUT", TableName[BHCC_WQ159914B_OUT] )If that column does not have unique values, then you'll need to add additional columns inside MATCHBY so their combination is something unique.
- Pquinlan212 years agoFrequent Visitor