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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
trupac
Frequent Visitor

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.

Screenshot 2024-05-27 151328.png

 

Thank you!

2 REPLIES 2
vicky_
Super User
Super User

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
Frequent Visitor

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

Screenshot 2024-05-29 102445.png

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors