Forum Discussion
Cumulative Running Total
Hi all,
I have a sales table with 3 dimensions (Dates, Stores, Products).
I have a measure to calculate 6-month sales running total:
[SAS] = CALCULATE(SUM(L_Sales[Amount]),DATESINPERIOD(L_Date[Date],LASTDATE(L_Date[Date]),-6,MONTH))
Then its share:
My goal is to have a measure (or calculated column, please advise which option is better?) to rank products in terms of its SAS Share Cumulative. My understanding is to do this, I need to put measure [SAS_Share] in a calculated column so that I can preference in the [SAS_Cumulative] measure. This is what I have:
L_Products[SAS] = [SAS]
I think the [SAS_Share_Cumulative] is correct, but the L_Products[SAS] is incorrect. Its values are different from [SAS]. I think this is due to context transition when preferencing a measure in row contexts. My sales table does have an ID field (all rows are unique).
Please help me:
1. Is this the right way to find [SAS_Share_Cumulative] (through a calculated column in Products table), and should it be a measure or calculated column?
2. If so, what I have for L_Products[SAS] is incorrect, please help me fix it. Explanations would be greatly appreciated!
Thank you so so much!
2 Replies
- Greg_DecklerCommunity Champion
longpham03 - There is a running total quick measure available.
This might help:
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008Otherwise, Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. - amitchandakSuper User
longpham03 , Can you share sample data and sample output in table format?
There is an option in quick measure to create a running total measure, you can try that