Forum Discussion
YTD basis current month
Hi
I need to create YTD value but till current month only. like in the below table YTD should be 3263.7 as we are in June month and next month it should be 3807.65.
| Month | Amount |
| Jan'22 | 543.95 |
| Feb'22 | 543.95 |
| Mar'22 | 543.95 |
| Apr'22 | 543.95 |
| May'22 | 543.95 |
| Jun'22 | 543.95 |
| Jul'22 | 543.95 |
| Aug'22 | 543.95 |
| Sep'22 | 543.95 |
| Oct'22 | 543.95 |
| Nov'22 | 543.95 |
| Dec'22 | 543.95 |
Hi, Gopinath_iyer
In your case, it would be better to need a date column.
YTD = CALCULATE ( SUM ( 'Table'[Amount] ), FILTER ( ALL ( 'Table' ), MONTH ( [Date] ) <= MONTH ( TODAY () ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Seanan
Solution Supplier
You can create a measure to calculate this using the following code. Just replace the 'Table (4)'[Amount] with your own values
CurrentYTD = TOTALYTD(SUM('Table (4)'[Amount]),'Table (4)'[Dates], 'Table (4)'[Dates] < TODAY())If this helps solve your issue please could you accept this as the solution.
Kind regards,
Seanan
- VahidDM
Super User
If there is no Date table and your Month column is a date column, you can use the below DAX:
YTD = CALCULATE(SUM('Table'[Amount]),'Table'[Date or Month]<=TODAY())If your Month Column is not a date column, you need to add a date column to your table and use that in the formula. - v-zhangti
Community Support
Hi, Gopinath_iyer
In your case, it would be better to need a date column.
YTD = CALCULATE ( SUM ( 'Table'[Amount] ), FILTER ( ALL ( 'Table' ), MONTH ( [Date] ) <= MONTH ( TODAY () ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.