cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NI New Member
New Member

Running Total by date based on value in another column

I want a running total by date for the Amount Column which should be different for each Security ID.Capture.PNG

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Running Total by date based on value in another column

Hi @NI

 

First add an Index Column from Query Editor or Power Query

 

6500.png

View solution in original post

Super User
Super User

Re: Running Total by date based on value in another column

@NI

 

Now you can get the expected Cumulative  Values using this Calculated Column

 

Cumulative =
CALCULATE (
    SUM ( TableName[Amount] ),
    FILTER (
        ALLEXCEPT ( TableName, TableName[Security ID] ),
        TableName[Index] <= EARLIER ( TableName[Index] )
    )
)

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Running Total by date based on value in another column

Hi @NI

 

First add an Index Column from Query Editor or Power Query

 

6500.png

View solution in original post

Super User
Super User

Re: Running Total by date based on value in another column

@NI

 

Now you can get the expected Cumulative  Values using this Calculated Column

 

Cumulative =
CALCULATE (
    SUM ( TableName[Amount] ),
    FILTER (
        ALLEXCEPT ( TableName, TableName[Security ID] ),
        TableName[Index] <= EARLIER ( TableName[Index] )
    )
)

View solution in original post

Super User
Super User

Re: Running Total by date based on value in another column

eranatatera Frequent Visitor
Frequent Visitor

Re: Running Total by date based on value in another column

hi @Zubair_Muhammad 

I have a follow up qustion about your amazing explanation, 

let's assume I have another "Country" column at the table, which I want to take as a paramater while calculating the running total, so that the cumulative total column will show not only cumulative total over time by securtiy Id but also by country, like in the example below- how should I revise the calculation in order to do so? 

 

Thanks ! 

 

Test.PNG

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 142 members 1,661 guests
Please welcome our newest community members: