Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
wokka
Helper IV
Helper IV

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.

 

1 ACCEPTED SOLUTION
kushanNa
Super User
Super User

Hi @wokka 

 

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 

View solution in original post

4 REPLIES 4
kushanNa
Super User
Super User

Hi @wokka 

 

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 

Hi @wokka,

 

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

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

Hi @wokka,

 

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.
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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.