March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Using a report page's Filters on this visual / page / all pages | created_date | filter type = Relative Date | Show items when the value = is in the last 30 days configuration its very straight forward to create views based on past 30 days.
That said what's the recommended syntax for creating . . .
1) A measure [ / statistic / fact ] value using dax syntax to compute something based on created_date is in the last 30 days from todays date?
2) A model | transform data | copy of existing table with m-code that limits table records to those where created_date is in the last 30 days from todays date?
Solved! Go to Solution.
HI @rob_mysbxsec,
#1, You can create a measure extract the current date and manually calculate the previous date to filter on your tables. For extract value operations, you can use selectedvalue(all types of values and not suitable to handle multiple selections) or other aggregate functions(suitable for numeric value for date values).
Using the SELECTEDVALUE function in DAX
#2, You can add a filter on your date field to filter the range of records, please take a look at the following links to know more about the operations:
PowerQuery Dynamic Date Dimension Table Filtering
Power Query Current Date Filter
Regards,
Xiaoxin Sheng
HI @rob_mysbxsec,
#1, You can create a measure extract the current date and manually calculate the previous date to filter on your tables. For extract value operations, you can use selectedvalue(all types of values and not suitable to handle multiple selections) or other aggregate functions(suitable for numeric value for date values).
Using the SELECTEDVALUE function in DAX
#2, You can add a filter on your date field to filter the range of records, please take a look at the following links to know more about the operations:
PowerQuery Dynamic Date Dimension Table Filtering
Power Query Current Date Filter
Regards,
Xiaoxin Sheng
@rob_mysbxsec , On way is to use relative date slicer and limit the data on page for last 30 Days.
Another is have a measure like this with help from date table
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],today(),-30,DAY))
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 :radacad sqlbi My Video Series Appreciate your Kudos.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |