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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Ideas to restrict the Data

Hi all,

 

Iam looking for your ideas/suggestions for my requirment.

 

In my report, i want the user to see data for 30 days(Refresh date) only at every time. Initially i need to show the data for 30 days from latest refresh date. If user selects any other date, even then he/she need to see 30 days data from date of selection.

 

Let me know what would be better way to do this

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , if you can use relative date slicer, nothing like that

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

second in you calendar have a column like this

Is Last 30= if('Date'[Date]<=TODAY() && 'Date'[Date]>=TODAY()-30,"Last 30 days","Other Date")

Use a slicer of that

 

Or create measure with last 30 day filter

 

Measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = _max-30

return
calculate(Table[Value],filter(all('Date'),'Date'[Date]>=_min && 'Date'[Date]<=_max))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.