Forum Discussion
DAX: How to perform a cummulative summation
- 10 years ago
First you need to have a seperate date table in order to perfom date calculations...
Step 1 : Create a date table -> Go to Modelling click New Table -> enter Dates = CALENDARAUTO()..Now you have a date table call Dates..-> New Column in this table Month = MONTH(Dates[Date])
Step 2 : Create Relantionship between your yourtable[Dates] ( the new only dates you created ) and Dates[Date] ( the calculated table)
Step 3 : Rewrite your formula to Measure = CALCULATE(
SUM(rprtsolarhistorical[Daily Output]);
FILTER(
ALL(Dates[Dates]);
Dates[Date]) <= MAX(Dates[Date])
)
)Step 4: add the months field from the new Dates table and the "measure"
Hope this works
Hi konstantinos Cheers - I want to show all the years on the same graph. One line for each different year. The axis is our season (just a financial year - 1st July to 30th June)
Cheers.
elliotdixon An approach ( maybe not the best one - but I don't work much with fiscal dates ) maybe
YTD Current Fiscal = TOTALYTD(SUM(Sales[Amount);'Dates'[Date];"6-30") - The last one is for specifying the end of year ( Fiscal )
Previous YTD Fiscal = CALCULATE([YTD Current Fiscal];DATEADD('Dates'[Date];-1;YEAR))
2 Years Before YTD = CALCULATE([YTD Current Fiscal];DATEADD('Dates'[Date];-2;YEAR))
This way you can have any fiscal year dates in axis and compare all of them..Also can slice on Years
axis = fiscal year 2015 will show also 2014 & 2013
axis = fiscal year 2013 will show also 2012 & 2011
Hope it works..