cancel
Showing results for 
Search instead for 
Did you mean: 
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 🙂

Proud to be a Super User!

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 🙂

Proud to be a Super User!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors