Forum Discussion
Paginated report - optional parameter
- 4 years ago
Hi,
Thank you for your answer!
I did solve it in this way:
1. Add a 'dummy' item called 'All' to the list of items in parameter query.
2. Make the new item 'All' defualt. You could also use 'Null' here.
3. Modified the DAX query in VBA with query.commandtext where I entered the command IIF(Parameter.Value = "All", "", "__Usefilter"), meaning if there is 'All' selected then do not use the filter, but if one item is selected then use the filter.
Hope it helps.
Thank you!
Hi mkavcic
If there is no default value for the optional parameter, then how would we handle it.
I need help with DAX query, how to ignore the optional parameters. If I use or condition to check if its blank or the value passed, it is very slow.
It will be very helpful for me.
- mkavcic4 years agoFrequent Visitor
Hi Surendar88
You should add a union sql to the dataset for the parameter. In the union add 'All' to the dataset.
Then in parameters, add 'All' option as the default option.
Then in main report dataset query, you need to edit query in VBA code where you check for 'All' option in the parameter and if it's there, then you don't use this parameter in the query, and if it's selected, then you use it in the query.
So you created a dynamic query.Hope it helps.