locked
DAX PowerPivot DateAdd - I want to use a formula for interval RRS feed

  • Question

  • I have a measure that does what I ask:

    =[USTotalSupply]-CALCULATE([USTotalSupply],DATEADD(Calendar[Date],-2,year))

    I want to modify the above so that the Interval argument for DateAdd is a formula:

    I have tried DATEADD(Calendar[Date],2011-Year(Calendar[Date]),year)

    and this is the error message I receive: "The value for column 'Date' in table 'Calendar' cannot be determined in the current context."

    Does anyone have a suggestion on how to make this formula work?  Thank you for the help.

    Monday, June 10, 2013 7:49 PM

Answers

  • Hi Scott7789,

    The DATEADD function syntax is:
    DATEADD(<dates>,<number_of_intervals>,<interval>)

    Number_of_intervals: An integer that specifies the number of intervals to add to or subtract from the dates

    It isn't support to specify an expression for "Number_of_intervals" argument

    Best Regards,


    Elvis Long
    TechNet Community Support

    • Marked as answer by Elvis Long Wednesday, June 19, 2013 8:51 AM
    Monday, June 17, 2013 7:21 AM