Forum Discussion
M Query parameter binding in Power BI
As mentioned, slicer selections cannot be passed back to the query editor. They stay in the semantic model and are meant to be used for data modelling. Your alternatives are:
- Use a multi-selection parameter. You can follow this route if you intend to give the pbix to users and they have access to the underlying data source. The parameter can also be edited in the service but whoever edits must be the owner of the semantic which ownership can be achieved by taking it over and granting he/she has access to the data source.
- Add all category values to the model. In your case (based on M parameter code provided), all site ids must be added to the model so users can select the ones they're interested in via a slicer. If the storage mode is via DQ, I don't see a reason why the need for a parameter to filter the site id. If loading everything affects performance, I would suggest to pre-select just a site id either from the slicer or the filter pane and add the apply slicer button.
Hi danextian
Thank you again, for your prompt response.
You are right there is no need to include site_id as a parameter as slicer works fine with Direct query. Our actual use case involves fetching data from an event based fact table based on the between condition applied from what users have selected in the from and to date slicers. We have a Startdate and EndDate calendar tables and are trying to use parameter binding to fetch only the data that is filtered based on datetimes selected by the users. The slicers are getting values from the calendar table fields. We were first trying to achieve this with the Site_Id column.