cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mansi64011 Frequent Visitor
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
Super User
Super User

Re: Running total by Account

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

Best
Darek

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)