Forum Discussion
multiple year to dates lines in one visual
- 5 years ago
Hi Anonymous ,
Try the following formula:
Cumulative All Years = var t = CALCULATE( SUM(Shipments[ShippedPrice]), FILTER( ALL(Shipments), Shipments[DateShipped] <= MAX(Shipments[DateShipped]) ), VALUES(Shipments[Date Shipped Year]) ) var result = IF( MONTH(MAX(Shipments[DateShipped]))<=MONTH(LASTDATE(ALL(Shipments[DateShipped]))), t ) return resultIf the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
If you want the data to stop to a certain month / week that is exactly what you should write to the filter.
E.g. for the month level ( you are likely to guess how to make it with && condition for a week too):
FILTER('Calendar';'Calendar'[Month Number] <= MONTH(today()))'Calendar'[Month Number] you can replace with MONTH(table[date])
See more info on how to calculate with dates:
https://www.plainlyresults.com/blog/power-bi-dax-how-to-calculate-and-filter-based-on-dates/