Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Estimated.
I have the following problem with some DAX formulas, where I want to calculate last year's sales using DATEADD.
The formulas would be as follows:
Hi, @Syndicate_Admin ;
Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Syndicate_Admin ;
Try it.
Ytd = CALCULATE(SUM('Table'[value]),DATESYTD('Table'[Date]))
Lytd =
var _max=CALCULATE(MAX('Table'[Date]),ALL('Table'))
return CALCULATE(SUM('Table'[value]),FILTER('Table',[Date]>=DATE(YEAR( _max)-1,1,1)&&[Date]<=DATE(YEAR(_max)-1,MONTH(_max),DAY(_max))))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
You must have a calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number. Create a relationship from the Period column to the Date column of the Calendar Table. To your visual, filter and slicers, drag any date field from the Calendar Table. Write this measure
LYTD = CALCULATE([YTD],SAMEPERIODLASTYEAR(Calendar[Date]))
Hope this helps.
Thank you dear!
I followed the advice to create a month column in the calendar table, and in the visual filter of the card, select the months that interested me to calculate growth (1, 2, 3,... 7).
And then, I used the following formulas.
Please follow the recommendations in this thread to help us help you
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Proud to be a Super User!
Paul on Linkedin.
Dont Use YTD in Lytd
LYTD= CALCULATE([sum of sale],DATEADD('PM CHILE Premium'[Period],-1,YEAR))
Thank you dear, unfortunately it did not work for me, but by following your advice, I was inspired to make the following modifications:
I created a Calendar Table and related my Base to it.
1) LYTD = CALCULATE([Medidas],DATEADD(Calendario[Date],-1,YEAR))
2)