Forum Discussion
Paginated Report
Hi LaurenzR , Thank you for reaching out to the Microsoft Community Forum.
Separate the All case from the filtered case. Keep your current parameter for customers, but add a second flag parameter (e.g., Show All). Then in the dataset parameter mapping, pass the customer values only when filtering is needed and pass Nothing/blank when All is selected so no filter gets applied. If your setup doesn’t handle blank cleanly, use two datasets (one with RSCustomDaxFilter, one without) and switch between them, this avoids the issue entirely.
But if i pass Nothing to the RSCustomDaxFilter Function, then i wont get any customers back or am i wrong
- v-hashadapu3 months agoCommunity Support
Hi LaurenzR , yeah, my bad, try using one dataset/query with RSCustomDaxFilter for selected customers and another dataset/query without any customer filter for All, then switch between them using a parameter.
- LaurenzR3 months agoFrequent Visitor
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
- v-hashadapu3 months agoCommunity Support
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])
)
)