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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.