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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors