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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.