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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
StidifordN
Helper III
Helper III

Cumulative Spend of multiple years on single axis

Morning all, 

 

I'm thinking this is simple but not having any luck shooting in the dark.

 

Chart1.JPG

I have the above chart - cumulative spend of each calendar year.  
All I need is to shift the cumulative CY's into a single range - January to December so CY18, CY19 and CY20 sit atop each other.

 

Cumulative spend code

 

 

Total Spend AU Cumulative = 
CALCULATE(
SUM(APAll[NET_AMOUNT_AU]),
FILTER(ALLSELECTED(APAll[PTRN_POSTED (bins)]),
ISONORAFTER(APAll[PTRN_POSTED (bins)],MAX(APAll[PTRN_POSTED (bins)]),DESC)))

 

 

Any assistance will be highly appreciated as always.

1 ACCEPTED SOLUTION

Change your X axis to just the month name and place the year to the legend. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
StidifordN
Helper III
Helper III

FYI

Column "PTRN_POSTED (bins)" is grouped by month.  Column "PTRN_POSTED" exists with the full date info.

 

Group1.JPG

I did not get it completely. But if you want all ytd's to be shown in 2020 , you can use datesytd and totalytd.

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
2 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Year))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the response.

A rough example image below of what i'm chasing - regardless i'll give your suggestion a go unless you respond otherwise.

 

C1apture.JPG

Change your X axis to just the month name and place the year to the legend. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Dan, 

 

I attempted this and made it work but only by reverting back to using the month number, not the month word (as PBI likely doesn't see the min/max of the month words)

 

1C1apture.JPG

and needed to change the Cumulative code to suit

Total Spend AU Cumulative = 
CALCULATE(
SUM(APAll[NET_AMOUNT_AU]),
FILTER(ALLSELECTED(APAll[ReportingMonth]),
ISONORAFTER(APAll[ReportingMonth],MAX(APAll[ReportingMonth]),DESC)))


Is there an way to change what the X-axis titles are from what the data is?


Power bi sorts text alpabetically. You may use a month name column but needs to be sorted by month number or just use the date then select just the month from the hierarchy.




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors