Forum Discussion
Anonymous
3 years agoNot applicable
Showing latest date before specific date
Hi all I am trying only to show the client's latest ticket date if it's older than two weeks using DAX. For example, today is the 21st and 2 weeks ago it was the 7th, I only want to show the ...
- 3 years ago
Thank you for sample data. Here is the code:
Customers with last ticket older than 2 weeks ago = var customer_last_ticket = MAXX( DISTINCT('Sample'[client_id]); MAX('Sample'[created_at]) ) return IF(DATEDIFF(customer_last_ticket;TODAY();DAY)>=14;customer_last_ticket)In the variable customer_last_ticket we are storing an information about last ticket per customer
Then if this ticket is older than 14 days ago we are displaying int 🙂
I hope that this is what you've wanted.
bolfri
Solution Sage
3 years agoThank you for sample data. Here is the code:
Customers with last ticket older than 2 weeks ago =
var customer_last_ticket =
MAXX(
DISTINCT('Sample'[client_id]);
MAX('Sample'[created_at])
)
return IF(DATEDIFF(customer_last_ticket;TODAY();DAY)>=14;customer_last_ticket)In the variable customer_last_ticket we are storing an information about last ticket per customer
Then if this ticket is older than 14 days ago we are displaying int 🙂
I hope that this is what you've wanted.
Anonymous
3 years agoNot applicable
Okay this has worked thank you so much!! I removed and re-added the data and it started working as expected much appreciated!!!