Forum Discussion
Report Builder - Pass parameter values to semantic model
- 21 days ago
I think I did not understand your need
Can you try the following steps (even in import mode, it should work)- Right click on the dataset for which you want to add some filters and select Dataset Propreties
You should have something like:
EVALUATE
SUMMARIZECOLUMNS(ColumnName...)
And replace it by the following code snippet
DEFINE
VAR param1 = @ParamName (Name of the first parameter you want to test)
EVALUATE
FILTER( TableName, TableName['ColumnToFilter'] = param1) - Link your parameter to the query, right click on your dataset --> Dataset propreties -->Parameters
and here pass the name of your parameter
- Run your query, normally it will ask to pass paramter BEFORE to generate the report
- Right click on the dataset for which you want to add some filters and select Dataset Propreties
Hi ldwf, to add to the steps above, the key point is where the filter lives. If the date filter is applied in the dataset Filters tab or in a tablix filter, the report still pulls the full result and filters it afterwards. If the filter is part of the DAX query itself, either through the query designer filter pane with the parameter box ticked or through a DEFINE VAR with the @parameter mapped in Dataset Properties, the semantic model engine only returns the matching rows. You do not need to change the semantic model for this, so other reports that use it are not affected. Also note that if the model is in Import mode the data is already in memory, so the benefit is a smaller result set sent to the report, while with DirectQuery the filter can also flow through to the SQL source.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.