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
sshiny
Helper II
Helper II

DAX- Date

 I am getting data for the last 7th day (Displays 29th Dec data as today is Jan 5th)using the below DAX

Last 7 days = TODAY()-7
 
I need a DAX to get the LAST 7 DAYS data. Please help @amitchandak 
1 ACCEPTED SOLUTION
visheshjain
Impactful Individual
Impactful Individual

Hello @sshiny,

 

The measure that you wrote is a scalar value and will give you only one value.

From what I have understood, you need to filter the calendar table using something like this:

 

FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() )

This will give a table of the Last 7 days or you can write a measure something like this

 
Count = CALCULATE(COUNTROWS('Calendar'), FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() ))

 

visheshjain_0-1672917044269.png

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



View solution in original post

2 REPLIES 2
visheshjain
Impactful Individual
Impactful Individual

Hello @sshiny,

 

The measure that you wrote is a scalar value and will give you only one value.

From what I have understood, you need to filter the calendar table using something like this:

 

FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() )

This will give a table of the Last 7 days or you can write a measure something like this

 
Count = CALCULATE(COUNTROWS('Calendar'), FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() ))

 

visheshjain_0-1672917044269.png

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



Mahesh0016
Super User
Super User

@sshiny 
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
Top Kudoed Authors