Forum Discussion
Cumulative counts on line/bar graphs
- 3 years ago
Anonymous You will have do the calc at the year to have running total for each year. your measaure could be like below
Vol running total in Year =CALCULATE(SUM('Table'[Vol]),FILTER(ALLSELECTED('Table'[Date].[Year]),ISONORAFTER('Table'[Date].[Year], MAX('Table'[Date].[Year]), DESC)))here is the expected output - 3 years ago
Anonymous i am sharing updated solution, it will work on months and year both. have taken inspiration from below
Computing running totals in DAX - SQLBI
Anonymous You will have do the calc at the year to have running total for each year. your measaure could be like below
Thank you - I will give this a try, my only concern would be the need to adapt for monthly as opposed to yearly totals (although I do appreciate that this is something that I'd not mentioned!). The code I gave at the start works for the majority of the things I need, it just doesn't work when a there's no registrations in a particular year.
EDIT: Just tried it and it works pefectly on the year front, exactly what I needed it to do. I'll have to deal with months within a year next, would that be a case of just adding [month] in?
Thanks again
- Anonymous3 years agoNot applicable
negi007 Sorry to bring this back again, I feel like I am almost there but the final steps are eluding me.
I've attached some basic detail and a demo, I don't need to calculate values as such, so switched SUM for COUNT - but as you can see on the tabs in the below:
Annual - this works perfectly.
Monthly - this works well, but I would probably remove the gaps by switching to categorical (although not ideal when it comes to setting a date range on a larger data set).
Monthy - Team - here the DAX stops working as it has done previously (continuing to display the value even if nothing else has changed).
EDIT - Duplicate of Annual - ignore this! Hopefully the above three tabs are enough of a demo, I had thought that this would be relatively straightforward, but have struggled with it!