Forum Discussion
VinnyH
7 years agoFrequent Visitor
Flag when date threshold has been reached
Hello, I'm trying to create a dynamic report to show customer revenue data over a period of 6 months that will be automatically updated moving forward. I would like to show when a customer hasn't...
- 7 years ago
This will calculate how many days since the last sale happened. This assumes a Date table is set up.
Days Since Last Sale = CALCULATE( DATEDIFF(MAX(Sales[Date]),TODAY(),DAY), ALL('Date'[Date]) )It assumes your fiter context in the table has customers in it. In my sample data, the last sale for Customer 6 was May 15, 2019, so that was 93 days ago. You could then do whatever you want when that hits 90+ days.
edhans
Community Champion
7 years agoThis will calculate how many days since the last sale happened. This assumes a Date table is set up.
Days Since Last Sale =
CALCULATE(
DATEDIFF(MAX(Sales[Date]),TODAY(),DAY),
ALL('Date'[Date])
)It assumes your fiter context in the table has customers in it. In my sample data, the last sale for Customer 6 was May 15, 2019, so that was 93 days ago. You could then do whatever you want when that hits 90+ days.
- VinnyH7 years agoFrequent VisitorThat's absolutely fantastic, thank you. I would've been here forever trying to work that out!