Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Re: Calculating Last Year with SUMX and DateAdd

I would add a Year column to your table:


Year = YEAR([Date])


Then in your LY calculation, create this variable:


VAR __year = MAX([Year])


And then in your SUMX just FILTER yoru table to [Year]=__year - 1

I have book! Learn Power BI from Packt

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

Proud to be a Datanaut!

Laz Member

Re: Calculating Last Year with SUMX and DateAdd

Hi @Greg_Deckler,


I had managed to achieve the outcome i was looking for in Power BI through going back to the Drawing Board.


All my issues were resolved once i imported at a Transaction ID level, instead of my lowest level being Barcode, which is essentially Product ID.


I can explain in more detail, but that would be pointless now. With that said, thank you for all your input Smiley Happy

Maikeru Regular Visitor
Regular Visitor

Re: Calculating Last Year with SUMX and DateAdd

Dear @Laz
I happen to be facing a similar issue as you (SUMX formula on a time intelligence function), and wouldl be interested if you could share the details of the solution.

Thanks in advance!



Helpful resources

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 40 members 1,030 guests
Please welcome our newest community members: