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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

DateAdd Measure

Hi Guys,

 

Please I am trying to create new measure this the follwoing:

 

LY Sales = CALCULATE([TotalSales], DATEADD('Date'[Date],-1,Year))
 
PowerBI retrurns error on the 'Year'
  
Kindly help!
 
 
1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

If the issue still occur, kindly share your pbix to me . Please upload your files to One Drive and share the link here.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

If the issue still occur, kindly share your pbix to me . Please upload your files to One Drive and share the link here.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Stachu
Community Champion
Community Champion

what's the error exactly? What's the syntax for [Total Sales]?
is the Date table marked as Date table, with Date[Date] as key column? see here https://docs.microsoft.com/en-us/power-bi/desktop-date-tables

is the join set to 1:many with single direction?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Hi Stachu,

 

Please se the screen shoot above

ThanksThanks

Stachu
Community Champion
Community Champion

weird, syntax looks correct, but maybe you can try with this one:

LY Sales =
CALCULATE ( [TotalSales], DATEADD ( 'Date'[Date], -1, YEAR ) )

I usually use https://www.daxformatter.com/ to verify syntax, maybe the spaces+capital letters will help



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.