Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Morning all,
I'm thinking this is simple but not having any luck shooting in the dark.
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.
Solved! Go to Solution.
Change your X axis to just the month name and place the year to the legend.
FYI
Column "PTRN_POSTED (bins)" is grouped by month. Column "PTRN_POSTED" exists with the full date info.
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
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.
Change your X axis to just the month name and place the year to the legend.
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)
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?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 43 |