Forum Discussion
Paginated Report
Hi,
I tried that. I havo two tables one for each dataset. if everything is selected in the customer filter i want to hide the oder table and if only a few / not all customrs are selected i want to hide the oder table. But the Problem is, that the Query to the Modell is still executed for both Datasets and i get the Error again
Hi LaurenzR , I think the problem here is, as we discussed already RSCustomDaxFilter isn’t real DAX. It gets expanded by Report Builder into a long list of filter values. When you select all customers, that list becomes huge and can exceed what the engine can handle in one query and may fail in the Service. You also can’t make it conditional, if it’s in the query, it will always expand. So, I suggest you stop using it for this case and handle the filter directly in DAX, where All means no filter instead of passing thousands of values.
Pass your multi-value parameter as usual and then handle the filter directly in the dataset query using a pattern like this:
EVALUATE
VAR _SelectedCustomers = @CustomerParam
VAR _AllCustomersCount = COUNTROWS(ALL('Customer'[Customer]))
VAR _SelectedCount = COUNTROWS(_SelectedCustomers)
RETURN
CALCULATETABLE (
<your base query>,
IF (
_SelectedCount = _AllCustomersCount,
TRUE(), -- All selected → no filter
TREATAS(_SelectedCustomers, 'Customer'[Customer])
)
)