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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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