Reputation: 1
I have two parameters in the Power BI report builder: one of them is Division (as Parent) and other one is Unit (as Child), that means by selecting each division(s) I should see its related units.
It works fine when I select single division and I can see list of units in the unit parameter.
But the problem is, when I select multiple divisions, then Unit parameter is empty.
When I select single division:
When I select multiple divisions:
Here is the DAX code:
Evaluate
DISTINCT(SELECTCOLUMNS(
FILTER('ActionPlan','ActionPlan'[Division] IN {@Division} && LEFT('ActionPlan'[Unit],2) <> "**"),
"Unit",'ActionPlan'[Unit]
)
)
Could you please advise how can I solve this issue?
Upvotes: 0
Views: 1331
Reputation: 206
The DAX you have written treats the Division parameter as a single string "div1,div2". What you should be using is the paginated report function RSCustomDaxFilter. This is an MDX function that you can insert in your DAX query (only works in paginated reports). Here's the syntax: RSCustomDaxFilter(@Division,EqualToCondition,[ActionPlan].[Division],String) The query engine will translate this function ino multiple filters (one for each selected division) !!The third argument should be written with an MDX syntax [ActionPlan].[Division] not 'ActionPlan'[Division]. This function will be used automatically if you build your query in the designer (drag and drop rather than writting it). Make sure you specify that the parameter in the query allows multiple values.
Upvotes: 0