Forum Discussion
Using a slicer to compare two rows in the same table
- 4 years ago
Hi Anonymous
Thank you for the explanation. Based on the sample data, you can create below measure.
Current Comment = VAR maxDate = CALCULATE(MAX(Record_Table[Date]),ALL(Record_Table)) VAR currentComment = CALCULATE(MAX(Record_Table[Comments]),ALLEXCEPT(Record_Table,Record_Table[Record]),Record_Table[Date]=maxDate) VAR initialComment = SELECTEDVALUE(Record_Table[Comments]) RETURN IF(currentComment = initialComment,BLANK(),currentComment)Put Date column into a slicer. Put Record, Comments and above measure into a table visual. Comments column will show comments on a selected initial date. You can rename Comments column for this table visual specificially.
Let me know if you have any questions.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi, and thanks for the questions! For my specific example, I am most interested "what is the latest snapshot of information". So there will be one latest record date. Generically it would be nice to be able to be dynamic with both beginning and end dates, but I'm satisfied for my purposes to only worry about a dynamic start date.
With regards to your second question, if there is no record for my selected "initial" date, I'm happy to ignore it. With the data I'm using, records persist. So, if it wasn't there on July 3, for example, it's also not going to be present at an earlier date.
Hi Anonymous
Thank you for the explanation. Based on the sample data, you can create below measure.
Current Comment =
VAR maxDate = CALCULATE(MAX(Record_Table[Date]),ALL(Record_Table))
VAR currentComment = CALCULATE(MAX(Record_Table[Comments]),ALLEXCEPT(Record_Table,Record_Table[Record]),Record_Table[Date]=maxDate)
VAR initialComment = SELECTEDVALUE(Record_Table[Comments])
RETURN
IF(currentComment = initialComment,BLANK(),currentComment)
Put Date column into a slicer. Put Record, Comments and above measure into a table visual. Comments column will show comments on a selected initial date. You can rename Comments column for this table visual specificially.
Let me know if you have any questions.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.