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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.