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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Restrict the Data in Report

Hi all,

 

I have a Daily frequency Report which get Refreshed Daily. I want to restrict the Data to 30 days for user. for example-when user opens the report, he should see only data from current date to 30 days back. if user selects any other date (march24th), he should see data from March24th to april 24th. So, whatever Date he selects he should get data for 30 days from Date of selection.

 

Here he should also have feasibility to get Data for one day. i.e he should also be able to see data for single day(March 28, April 15,...)

 

Looking for solution asap.

 

TIA

1 REPLY 1
TomMartens
Super User
Super User

Hey @Anonymous ,

 

what you want can be achieved by using a dedicated calendar table and measures.
Here is an example how a measure may look like:

Quantity last 30 dayy = 
var _today = TODAY()
var _todayDate = DATE(YEAR(_today) , MONTH(_today) , DAY(_today))
var _offset = 30
var _dateBackThen = _todayDate - _offset
return
CALCULATE(
    SUM('Fact Sale'[Quantity])
    , DATESBETWEEN('Dimension Date'[Date] , _dateBackThen , _todayDate)
)
 

This article contains almost everything that you can imagine how to answer time-related questions: https://www.daxpatterns.com/time-patterns/

 

Hopefully, this gets you started.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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