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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mansi64011
Frequent Visitor

Running total by Account

Hello,
I wanted to create a Running Total column in DAX.
I have an Invoice Table which looks like below:
Account IDInvoice Date Invoice PriceRunning Total
110/13/20165050
112/10/2017279329
12/23/201813801709
24/15/2018325325
23/4/20197871112
36/19/201822
49/10/201723562356
47/30/2018352391
49/9/20182542645
45/7/20197563401
53/12/20173737
58/26/2018876913

My SQL code for that is:
SELECT SUM(InvoicePrice) OVER (Partition by AccountID Order by InvoiceDate) asRunningTotal
FROM Invoices
 
Note: 1 account can have many invoices so I partitioned by account ID as I want to see running total for each account.
1 REPLY 1
Anonymous
Not applicable

Why in DAX and not in Power Query, where you should do it?

Best
Darek

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.