Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I am trying to figure out how to compare a day of the week to an average of the previous 20 weeks, same day. So if I am looking at, Tuesday, 3/24/2020, I want to compare that to the average of the previous 20 Tuesdays.
any thoughts?
I thank you in advance, you all are ALWAYS so helpful!
Solved! Go to Solution.
Hi @cwnoll ,
We can use the following measure to meet your requirement.
Measure =
CALCULATE (
    AVERAGE ( 'Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Table'[Date] ),
        'Table'[Date]>= MIN ( 'Table'[Date] ) - 2 * 7
        && 'Table'[Date] < MIN ( 'Table'[Date] )
        && WEEKDAY ( 'Table'[Date] ) = WEEKDAY ( MIN ( 'Table'[Date] ) )
    )
)
Then we can get the result like this,
And you can change the -2*7 to -20*7 to meet the average of the previous 20 Weeks.
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
By the way, pbix file as attached.
Best regards,
Hi @cwnoll ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @cwnoll ,
We can use the following measure to meet your requirement.
Measure =
CALCULATE (
    AVERAGE ( 'Table'[values] ),
    FILTER (
        ALLSELECTED ( 'Table'[Date] ),
        'Table'[Date]>= MIN ( 'Table'[Date] ) - 2 * 7
        && 'Table'[Date] < MIN ( 'Table'[Date] )
        && WEEKDAY ( 'Table'[Date] ) = WEEKDAY ( MIN ( 'Table'[Date] ) )
    )
)
Then we can get the result like this,
And you can change the -2*7 to -20*7 to meet the average of the previous 20 Weeks.
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
By the way, pbix file as attached.
Best regards,
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Second, WEEKNUM will get you the week number and WEEKDAY will tell you what day it is.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.