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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nleuck_101
Responsive Resident
Responsive Resident

How to get the total views 7 days ago

Hello All,

 

I'm having issues for some reason coming up with a simple measure. I have a date field and I created a measure that calculates the Total Views ( SUM(Table('Views')). I would like to create a measure that get me the Total Views 7 days ago. I would like to get the Total Views on 1/8/2025 (3,737) but I'm getting over 60K. My max date is always the previous day. Any help would be greatly appreciated.

 

nleuck_101_0-1737059800572.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nleuck_101 

 

Please try the following measure:

Last7DayViews = 
CALCULATE(
    SUM('Table'[Views]),
    FILTER(
        'Table',
        'Table'[Date] = MAX('Table'[Date]) - 7
    )
)

vxianjtanmsft_0-1737081960498.png

Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Bibiano_Geraldo
Super User
Super User

Hi @nleuck_101 ,

You can achieve your goal by this DAX:

Last7Days = 
CALCULATE(
    SUM('Table'[Views]),
    FILTER(
        'Table',
        'Table'[Date] = MAX('Table'[Date]) - 7
    )
)

Bibiano_Geraldo_0-1737098571606.png

 

Anonymous
Not applicable

Hi @nleuck_101 

 

Please try the following measure:

Last7DayViews = 
CALCULATE(
    SUM('Table'[Views]),
    FILTER(
        'Table',
        'Table'[Date] = MAX('Table'[Date]) - 7
    )
)

vxianjtanmsft_0-1737081960498.png

Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors