Hi,
I guess you want to add the filter in the Tabular Model table query, right ? So that , when the user or report connect to the model, the data is already filtered to last 7 days.
You could in the model, in table properties, change the Power Query to add the filter. For example :
The query would be like :
let
Source = #"*YourDataSource*",
dbo_DimProduct = Source{[Schema="dbo",Item="Table"]}[Data],
#"Filtered Rows" = Table.SelectRows(YourTable, each ([Date] > **Date.AddDays(DateTime.LocalNow(), -7**))))
in
#"Filtered Rows"
You may need to change above code to suit your model.
You could also click the design button to make the query in the Power Query Editor.
Reference : Date.AddDays
Regards,
Lukas
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
What can I do if my transaction log is full?--- Hot issues November
How to convert Profiler trace into a SQL Server table -- Hot issues November