Forum Discussion
Cumulative Total
Hi All,
I am trying to create a measure to get the total pax to be the number in the final month when I select a range of months. I.e In this instant, the total pax column sould show "2415" for every purchase month so the % of total pax column will show a cumulative increase in % from the first month to 100% in the final month. Is there a measure for this?
Thanks all in advance!
5 Replies
- StharwaniAdvocate II
You could try using
Calculate(Sum(totalPax),
Datesbetween(PurchaseDate, min(purchaseDate), max(PurchaseDate)))
- jacksonsongNew Member
Hi Stharwani,
Thanks for the response. When I put in the measure it was still showing the same numbers in the Sum pf Pax column. While I need it to show I.e "2415" for all purchase month as that would be the total at the end of the month range. Which will lead to the % of total pax measure calulate base on Sum of pax / Total Pax returning a cumulative increase in %.
thanks
- v-caliao-msftMicrosoft Employee
Hi jacksonsong,
In your sample data, the total pax is 6251, why do you need to show 2415 which is only the value for the last month?
Generally, to create a cumulative total, we can use the DAX below.Cumulative Quantity :=
CALCULATE (
SUM ( Transactions[Quantity] ),
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] <= MAX ( 'Date'[Date] )
)
)
Here are some useful links for you reference.If this is not what you want, please provide us more detail information, so that we can make further analysis.http://www.daxpatterns.com/cumulative-total/
https://javierguillen.wordpress.com/2012/11/28/running-total-techniques-in-dax/
Regards,
Charlie Liao