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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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