Forum Discussion
smerchant
7 years agoHelper I
Get First and Last Rows with all Columns
I have data something like this and I want get the first and last rows based on the date: I created some measure for example like InitialScore, LastScore, FirstDate...: InitialScore =
MINX(...
- Anonymous7 years ago
HI smerchant ,
You can consider to do unpivot columns on your fields, then you can simply write formula to calculate first/last records based on original category and attribute group.
Regards,
Xiaoxin Sheng
smerchant
7 years agoHelper I
Thanks. I might have failed to explain. I need to get all the columns and only first and last row by category based on the date (first and lastest)
I made another attempt through an identifier column. Not sure if this is most appropriate way, although, I do get the empty row on top which I suppose I can filter out.
Identifier =
IF (
MIN ( Sheet1[Date] ) = Sheet1[FirstTransactionDate],
"First Test",
IF (
MAX ( Sheet1[Date] ) = Sheet1[LastTransactionDate],
"Last Test",
BLANK ()
)
)This attempt also give the wrong sum for score columns