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 agoin what way? what values is it returning, or is it not returning any values ?
Anonymous
3 years agoNot applicable
Appolagies that was super vauge.
Its showing no values:
- johnt753 years ago
Super User
It works in my sample. Double check that the column which has the datetime in it is set as type datetime, both in Power Query and in Power BI desktop. If it was type text or something then that might explain it.
- Anonymous3 years agoNot applicable
Just checked and both are date time.