Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have one column of values and one of dates (daily time series data).
I want to create a column with the monthly & annual sum of the values like the below.
What is the DAX code?
Solved! Go to Solution.
Hi @mbegg
You can use the following DAX below:
Current Month = CALCULATE(SUM('TableName'[Value]),PARALLELPERIOD('Date'[Calendar Date],0,MONTH))
Current Year = CALCULATE(SUM('TableName'[Value]),PARALLELPERIOD('Date'[Calendar Date],0,YEAR)) NOTE: You will have to have a Date table mapped to your data.
You can find more details around a Date table here: http://radacad.com/do-you-need-a-date-dimension
Hi @mbegg
You can use the following DAX below:
Current Month = CALCULATE(SUM('TableName'[Value]),PARALLELPERIOD('Date'[Calendar Date],0,MONTH))
Current Year = CALCULATE(SUM('TableName'[Value]),PARALLELPERIOD('Date'[Calendar Date],0,YEAR)) NOTE: You will have to have a Date table mapped to your data.
You can find more details around a Date table here: http://radacad.com/do-you-need-a-date-dimension
You could also add calculated columns as shown below.
Value Mth =
CALCULATE (
SUM ( Table1[Value] ),
ALLEXCEPT ( Table1, Table1[Year], Table1[MonthNo] )
)
Value Yr = CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Year] ) )
Awesome, thanks for letting me know.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 127 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |