Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

DAX Help Cumulative Total for Current Year and Last Year

Hi, i wanted to create running totals for Current (2019) and Previous (2018) Years and show them in line chart with Short Month name. measure [2018] and measure [2019] is count of Incidents for year 2018 and 2019 respectively

Cumulative Incident 2018 = CALCULATE([2018], Filter(ALLSELECTED(CalendarTable), CalendarTable[Date] <= max(CalendarTable[Date])))

Cumulative Incident 2019 = CALCULATE([2019], Filter(ALLSELECTED(CalendarTable), CalendarTable[Date] <= max(CalendarTable[Date])))

 

but if i plot them on line graph with month short name (Jan, Feb, Mar to Dec) then it repeats the total value of Cumulative Incident 2018 for each month. Also for current year it repeats last month total for Months which do no have values available yet.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, Sorry please ignore it worked. i removed year from Filter

 

Thanks for your help. really appreciate.

 

thanks and regards.

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

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-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for looking into this. I have downloaded your file and gone through it. These 2 measures TITHW_TotalLYTDHW and TITHW_TotalYTDHW are giving actual values for rective months and years. But i want them cumulatively. I try puting below formula but its not giving cumulative. 

Cumulative =
CALCULATE([TITHW_TotalLYTDHW],FILTER(ALL(TheHardWay),[Year] = MAX(TheHardWay[Year]) && [MonthSort] <= MAX(TheHardWay[MonthSort])))
 
Thanks and Regards.
 
 
Anonymous
Not applicable

Hi, Sorry please ignore it worked. i removed year from Filter

 

Thanks for your help. really appreciate.

 

thanks and regards.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.