Forum Discussion
Pass slicer value to a TSQL query to pull data from SQL Server
HI
I have a powerbi desktop that pulls data from both an existing powerbi model , and I also need to add data from a separate SQL Server data source.
I havent done this before - can I please confirm that if I add SQL Server as a data source, will I need to add a local model or not please?
Also - how do I pass a slicer value to some DAX code to then fire at SQL Server please? The TSQL would be something simple like :
select * from Some_table
I can obtain the slicer value easily enough with SELECTEDVALUE
Half of the problem is knowing how to set this all up. Assume we already have 2 existing connections - one to data warehouse semantic model and one to SQL Server.
Thanks in advance.
Hi Anonymous
Yes you can pass values from a slicer to SQL query but you need to have that query in direct query mode
here is an example how to do it : https://www.youtube.com/watch?v=pXU_SpiBWUA&t=18s&ab_channel=DataPlatformCentral
4 Replies
- kushanNaSuper User
Hi Anonymous
Yes you can pass values from a slicer to SQL query but you need to have that query in direct query mode
here is an example how to do it : https://www.youtube.com/watch?v=pXU_SpiBWUA&t=18s&ab_channel=DataPlatformCentral
- v-achippaCommunity Support
Hi Anonymous,
Thank you for reaching out to Microsoft Fabric Community.
Thank you kushanNa for the prompt response.
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the super user resolved your issue? or let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.Thanks and regards,
Anjan Kumar Chippa
- v-achippaCommunity Support
Hi @wokka,
We wanted to kindly follow up to check if the solution provided by the super user resolved your issue.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa