Forum Discussion
Paginated Report
I tried checking if everything is selected and if so than ignore the parameter but you cant use conditions in combination with RSCustomdaxfilter so that did not work. also the all element did not work, because there would be 10 entries for "All" if there were 10 customers and when i made it that the All Element only appears once, then the RSCustomDaxfilter filters the dataset with the Value "all" and returns nothing because there is no such element in the base data.
i dont have any clue what else i could try
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.
- LaurenzR4 months agoFrequent Visitor
But if i pass Nothing to the RSCustomDaxFilter Function, then i wont get any customers back or am i wrong
- v-hashadapu4 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.
- LaurenzR4 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-hashadapu4 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])
)
)