Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mbegg
Advocate II
Advocate II

Create column of daily values summed across a month

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?

 

 Values.JPG

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

4 REPLIES 4
GilbertQ
Super User
Super User

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ, thank you, that works

 

 

@mbegg,

 

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] ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Awesome, thanks for letting me know.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.