Forum Discussion
Summary until today
Hi guys,
I have simple table with dates and daily budget, see below.
I want to create DAX which will calculate summary of budget column since beginning of currently selected year till today.
Note: I have full calendar with multiple years, here is just a sample data for better understanding
| Date | Weekday | Month | Week Nr | Budget |
| 12/01/25 | Sunday | January | 2 | € 2,184 |
| 13/01/25 | Monday | January | 3 | € 1,638 |
| 14/01/25 | Tuesday | January | 3 | € 1,638 |
| 15/01/25 | Wednesday | January | 3 | € 1,638 |
| 16/01/25 | Thursday | January | 3 | € 1,638 |
| 17/01/25 | Friday | January | 3 | € 2,184 |
| 18/01/25 | Saturday | January | 3 | € 2,184 |
| 19/01/25 | Sunday | January | 3 | € 2,184 |
| 20/01/25 | Monday | January | 4 | € 1,638 |
| 21/01/25 | Tuesday | January | 4 | € 1,638 |
| 22/01/25 | Wednesday | January | 4 | € 1,638 |
| 23/01/25 | Thursday | January | 4 | € 1,638 |
| 24/01/25 | Friday | January | 4 | € 2,184 |
| 25/01/25 | Saturday | January | 4 | € 2,184 |
| 26/01/25 | Sunday | January | 4 | € 2,184 |
| 27/01/25 | Monday | January | 5 | € 1,765 |
| 28/01/25 | Tuesday | January | 5 | € 1,765 |
| 29/01/25 | Wednesday | January | 5 | € 1,765 |
| 30/01/25 | Thursday | January | 5 | € 1,765 |
| 31/01/25 | Friday | January | 5 | € 2,353 |
5 Replies
- AnonymousNot applicable
Bibiano_Geraldo thanks, but thats not exactly what I want, since when I put it in the table, it will create calculation per each row (including the dates after today), which I dont want to.
I want to summary of all the budget since 1.1.2025 until todays date (24.1.2025). Today will be dynamic of course.
- Bibiano_GeraldoSuper User
Hi Anonymous ,
Now i got you, you want a comulative until today, please use the bellow measure to achieve your goal, and let me know if its all ok:
Cumulative Budget YTD = IF( HASONEVALUE('Table'[Date]), IF( MAX('Table'[Date]) > TODAY(), BLANK(), CALCULATE( SUM('Table'[Budget]), DATESYTD('Table'[Date]), 'Table'[Date] <= TODAY() ) ), CALCULATE( SUM('Table'[Budget]), DATESYTD('Table'[Date]), 'Table'[Date] <= TODAY() ) )You output should look like this:
- AnonymousNot applicable
Hi Bibiano_Geraldo ,
it works only when I filter data by date (days).
When I filter data by weeks or months, its showing data for whole year instead of data until current week or month
- Bibiano_GeraldoSuper User
Hi Anonymous ,
You can use DATESYTD function to achieve your goal, please use this measure DAX :
Cumulative Budget YTD = CALCULATE( SUM('Table'[Budget]), DATESYTD('Table'[Date]) )