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
AlexGurovich
Helper II
Helper II

Help with a simple cumulative sum. Newbie to Power BI.

Hi, I0m new to Power Bi.

 

Simple question: I have a table with 3 colmuns:

- TransactionId

- TransactionAmount

- TransactionMonth

 

I want to add a 4th column, TotalAmountofThisMonth, that sums up in each row the total $ amount of Transactions of each month.

 

So as an example, Januray sold $100+$200+$300 = $600. Hence, $600 should show up for column TotalAmountofThisMonth, in each  of the 3 rows that have "January" as its TransactionMonth.

 

What's the DAX expression for this????

 

TransactionId

TransactionAmount

TransactionMonth

1

$100

January

2

$200

January

3

$300

January

4

$400

February

5

$500

February

6

$600

March

7

$700

March

8

$800

March

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hello @AlexGurovich 

If  you want to just show the monthly total, you can create simple measure that sums up the values:

TotalAmountofThisMonth =
SUM ( Table[TransactionAmount] )

 

If you want this to be a physical column in your data model not just a column in a table or a matrix visual, you can try this:

TotalAmountofThisMonth =
CALCULATE (
    SUM ( Table[TransactionAmount] ),
    ALLEXCEPT ( Table, Table[TransactionMonth] )
)

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hello @AlexGurovich 

If  you want to just show the monthly total, you can create simple measure that sums up the values:

TotalAmountofThisMonth =
SUM ( Table[TransactionAmount] )

 

If you want this to be a physical column in your data model not just a column in a table or a matrix visual, you can try this:

TotalAmountofThisMonth =
CALCULATE (
    SUM ( Table[TransactionAmount] ),
    ALLEXCEPT ( Table, Table[TransactionMonth] )
)

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
kentyler
Solution Sage
Solution Sage

If you import this table into Power BI and create a Matrix, it will do the totaling automatically.MonthTotal.PNG

To calculate the total for each month we write a measure

Month Total =
VAR current_month = selectedvalue(Transactions[TransactionMonth])
var month_total = calculate(sum(Transactions[TransactionAmount]),Transactions[TransactionMonth] = current_month, ALL(Transactions))
RETURN month_total
first we get the month in the row the measure is running in using SELECTGEDVALUE()
then we use that value as a filter to total all the values for that month, we add ALL() to the calculate statement to be able to total all the rows in the transactions table, and not just the row the measure is running in
 
I'm a personal Power BI trainer Every time I answer a question I learn something.




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Excellent, thanks for the help and support. Kudos

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
Top Kudoed Authors