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
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
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.