cancel
Showing results for
Did you mean:
Member

## 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?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Create column of daily values summed across a month

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.

"Proud to be a Datanaut!"

Power BI Blog
4 REPLIES 4
Super User

## Re: Create column of daily values summed across a month

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.

"Proud to be a Datanaut!"

Power BI Blog
Highlighted
Member

## Re: Create column of daily values summed across a month

Hi @GilbertQ, thank you, that works

Super User

## Re: Create column of daily values summed across a month

Awesome, thanks for letting me know.

"Proud to be a Datanaut!"

Power BI Blog
Community Support Team

## Re: Create column of daily values summed across a month

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.

Announcements

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

#### Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

#### PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 27 members 994 guests
Recent signins: