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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
BJP99
New Member

Creating a Sum Based on Month

Hi,

 

I have budget data by month.  How do I go about creating a field that would add Months 1-8 of said data, ignoring the other 4 months.  This data being budget data does not have actual dates tied to it, just Month Names (Jan, Feb, Mar ect) or Number (1,2,3, ect).  Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @BJP99 

Please try the following Dax:

(Jan - Aug) = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH('Table'[Date])>=1 && MONTH('Table'[Date])<=8 && 'Table'[Account]=EARLIER('Table'[Account])))

 

Result:

vjialongymsft_0-1729213117774.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

8 REPLIES 8
Anonymous
Not applicable

Hi @BJP99 

Based on your needs, I have created the following table.

vjialongymsft_0-1729128938181.png

 

 

Then create a calculate column:

(Jan - Aug) = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH('Table'[Date])>=1 && MONTH('Table'[Date])<=8))

 

 

Drag the corresponding field to the matrix visual.

vjialongymsft_1-1729129064706.png

 

Drag to hide unwanted columns:
Solved: Matrix - Hide a column in visual but consider in c... - Microsoft Fabric Community

Result:

vjialongymsft_2-1729129321813.png

 

 

 

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

Hi, thank you for putting this together.  Unfortunately it is giving me the same value for everything.  

 

BJP99_0-1729171017342.png

 

Anonymous
Not applicable

Hi @BJP99 

Please try the following Dax:

(Jan - Aug) = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH('Table'[Date])>=1 && MONTH('Table'[Date])<=8 && 'Table'[Account]=EARLIER('Table'[Account])))

 

Result:

vjialongymsft_0-1729213117774.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

Hi, try 

Jan - Aug =
CALCULATE(
    SUM('Table'[Value]),
    FILTER('Table','Table'[Month] IN {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"}))
Or if you have Month Numbers;
Jan - Aug =
CALCULATE(
    SUM('Table'[Value]),
   'Table'[Month(number)>=1&&'Table'[Month(number)<=8]))
Nonessential
Frequent Visitor

Do you want a column that shows the sum of 'Amount' for months Jan-Aug in every cell?

Or do you want a Column for Jan, a Column for Feb etc? Either way, the columns would just have the same number all the way down in every cell....a Measure would be much more efficient.

How do you intend to display the calculation in your report?

I want a column that has Months 1-8 Added together.  I currently and viewing the data in a table that shows Months as columns and Accounts as the Rows.  The Budgets come in for each of the accounts per month in this view.  the source data is set up as row for each month with a value by account. 

 

This is what I want my tabke to look like:

 

Account      Jan     Feb   Mar Apr   May   Jun  Jul  Aug  Sep  Oct  Nov   Dec   (Jan - Aug)   FY

Acct 1         1         1.2     1.1  1.4     1       1.5   1.1   1.3    1.8    1.5   1.6   2.3           9.6        16.8

Acct 2         3    

Acct 3        2.1

Nonessential
Frequent Visitor

Do you want to create a measure or a calculated column? I assume you want a measure, if so you could do something like; Budget (Jan-Aug) = Calculate([Total Budget]), MonthNumber IN (1,2,3,4,5,6,7,8)). For this to work you would need the 'Total Budget' Measure which would just be a SUM of the Column you are performing the calculation on.

I think I would prefer a calculated column for this.  The Fields I have that would be based on this are Month and Amount.  Month has the Month Names, and Amount has the Amounts associated with this.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors