Forum Discussion
hassens
9 years agoRegular Visitor
Highlight Last Visit Within Table Based on Multiple Criteria
Hi,
I'm hoping someone may have tackled a problem similar to mine. I have a table similar in structure to the one below and I want to add a column that dynamically populates with a '1' IF it is the last date that store was visited within that Period.
| Visit ID | Store ID | Question | Answer | Period | Date | LastRead? |
| 1 | A | Question 1 | 1 | 01/01/2017 | ||
| 1 | A | Question 2 | 1 | 01/01/2017 | ||
| 2 | A | Question 1 | 1 | 02/01/2017 | 1 | |
| 2 | A | Question 2 | 1 | 02/01/2017 | 1 | |
| 3 | A | Question 1 | 2 | 03/05/2017 | 1 | |
| 3 | A | Question 2 | 2 | 03/05/2017 | 1 | |
| 4 | B | Question 1 | 1 | 05/01/2017 | ||
| 4 | B | Question 2 | 1 | 05/01/2017 | ||
| 5 | B | Question 1 | 1 | 10/02/2017 | 1 | |
| 5 | B | Question 2 | 1 | 10/02/2017 | 1 |
Thanks :)
Perhaps a measure like:
Measure = IF([Date]=CALCULATE(MAX([Date]),ALLEXCEPT([Period],[Store])),1,0)
2 Replies
- Greg_Deckler
Community Champion
Perhaps a measure like:
Measure = IF([Date]=CALCULATE(MAX([Date]),ALLEXCEPT([Period],[Store])),1,0)
- hassensRegular Visitor
Thanks for this - it worked perfectly!