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.
johnt75
Super User
3 years agoTry
Latest Ticket =
VAR LastTicket =
MAX ( 'Table'[Ticket time] )
RETURN
IF ( LastTicket <= ( TODAY () - 14 + TIME ( 23, 59, 59 ) ), LastTicket )
- Anonymous3 years agoNot applicable
Just tried and unfortunatly it doesnt work.
- johnt753 years ago
Super User
in what way? what values is it returning, or is it not returning any values ?
- Anonymous3 years agoNot applicable
Appolagies that was super vauge.
Its showing no values: