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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculating Sum for a Column by a Set Time Period from the Past

Hello, 

  I am attempting to create a bar chart with 12 columns for each month of the year. Each column will represent 6 months of data starting from each month. (ex. January will represent a 6 month outlook until June, February will show until July, etc.) I have the data in seperate columns for each month, but they are not filtered by the time period of six months (from the beginning of that month), instead, each column for each month has data for 2+ years, not the six month periods I'm looking for. 

 

I used the code below, but it is still not working for me. Any suggetions would be appreciated!

 

Thanks!

 

Jan6Months = CALCULATE(SUM(Pipeline_Outlook[January 2018]),FILTER(Pipeline_Outlook, Pipeline_Outlook[Close Date] = DATEADD(Pipeline_Outlook[Close Date],6, MONTH) ))

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous,

 

Modify your measure like pattern below and check if it can meet your requirement:

 

Jan6Months =
VAR selected_month =
SELECTEDVALUE ( Pipeline_Outlook[Close Date] )
RETURN
CALCULATE (
SUM ( Pipeline_Outlook[January 2018] ),
FILTER (
Pipeline_Outlook,
MONTH ( Pipeline_Outlook[Close Date] ) >= selected_month
&& Pipeline_Outlook
< selected_month + 6
)
)

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous,

 

Modify your measure like pattern below and check if it can meet your requirement:

 

Jan6Months =
VAR selected_month =
SELECTEDVALUE ( Pipeline_Outlook[Close Date] )
RETURN
CALCULATE (
SUM ( Pipeline_Outlook[January 2018] ),
FILTER (
Pipeline_Outlook,
MONTH ( Pipeline_Outlook[Close Date] ) >= selected_month
&& Pipeline_Outlook
< selected_month + 6
)
)

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors