Forum Discussion

trupac's avatar
trupac
Frequent Visitor
2 years ago

Week to week average variance

I am trying to get a column at the end that shows the week to week variance based on this 14 day data. There is a filter in my report that grabs the most recent 14 day data so the dates will constantly be refreshing.

 

I tried using average and sum formulas using DATESINPERIOD or DATE(TODAY()-14) but it says I have either too few or too many arguments.

 

Thank you!

2 Replies

  • It's not really possible to debug your DAX code if you haven't provided any. If you have a date table already, then the most optimal way would be to use the DATESINPERIOD() function - 

    So your code might look something like:

    CALCULATE(
        [Your variance measure],
        DATESINPERIOD(
            'Date'[Date],
            MAX('Date'[Date]),
            -14,
            DAY
        )
    )
    • trupac's avatar
      trupac
      Frequent Visitor

      I created a date table but my calculation keeps giving me this error: