cancel
Showing results for
Did you mean:

# Re: Running total

6963 Views
ValubiMartin Senior Member

## Running total

#### NAME:

Running total performance measure

#### DESCRIPTION:

Calculate the running total of some column containing numerical values over any given period of time.

#### PARAMETERS:

Name: Base value

Tooltip: The value you want to measure the running total performance on.

Type: Numerical field / measure

Name: Dates

Tooltip: The dates interval wherein you want to calculate the running total.

Type: Date field

#### DAX:

Approach if you have a time dimension:

`Running total of {Base value} =`

`Calculate(`

` SUM({Base value}),`

` FILTER(`

`  (ALL({Dates}),`

`  {Dates} <= MAX ( {Dates from time dimension} )`

` )`

`)`

Approach if you don't have a time dimension (this will only work if you have a row for each period of {Dates} in your date column):

`Running total of {Base value} =`

`Calculate(`

` SUM({Base value}),`

` FILTER(`

`  (ALL({Dates}),`

`  {Dates} <= MAX ( {Dates} )`

` )`

`)`

If you take a look at the .pbix, you'll find syntax for creating a time dimension and making the monthname + year column.

Don't hesitate to ask about the measure. I'll gladly elaborate on anything regarding it.

ValubiMartin Senior Member

## Re: Running total

I've edited a little in the post. There were a typo in the DAX formulas.

wynhopkins Member

## Re: Running total

I'd really like to see this implemented.   I'd label this Lifetime To Date

ArulselvanD07 Regular Visitor

## Re: Running total

Hi @ValubiMartin Is it possible to calculate running total for a measure instead of a physical column? Please let me know, thanks

ravik4934 Member

## Re: Running total

I have DataSet like Three Years(2016,2017,2018) and Want to show in line chart running total with X-axis as Month of every year and Y-axis having Price. When i implemented this dax for 2016,2017,2018 all are overlapping(having same value).

Highlighted
ArulselvanD07 Regular Visitor

## Re: Running total

Hi @ravik4934,

Pls share the data, your current result and the expected results. If possible please share the pbix file as well.

Thanks

ravik4934 Member

## Re: Running total

Thanks I have figured it out where i was wrong. I just updated your DAX as per my requirements. Now its working fine.
{"ft_lang_label":"__label__en","ft_lang_prob":0.85729855,"math_prob":0.7503018,"size":1787,"snap":"2019-13-2019-22","text_gpt3_token_len":432,"char_repetition_ratio":0.12563096,"word_repetition_ratio":0.073089704,"special_character_ratio":0.25405708,"punctuation_ratio":0.11304348,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98155034,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-23T12:01:45Z\",\"WARC-Record-ID\":\"<urn:uuid:5762ced7-0323-404c-8e20-137e699f059f>\",\"Content-Length\":\"522857\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1e898c2d-f5e3-4218-816f-5cc9a38b8a51>\",\"WARC-Concurrent-To\":\"<urn:uuid:3c82882f-e456-43fa-b2c5-0aa994a41619>\",\"WARC-IP-Address\":\"208.74.205.170\",\"WARC-Target-URI\":\"https://community.powerbi.com/t5/Quick-Measures-Gallery/Running-total/m-p/429873\",\"WARC-Payload-Digest\":\"sha1:B3FP675JCSXPGJWLZCKSQF7A7RUDQDVV\",\"WARC-Block-Digest\":\"sha1:6TBYNX33JBEWTP53YRT6XWGO67OES7VE\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912202781.83_warc_CC-MAIN-20190323101107-20190323123107-00461.warc.gz\"}"}