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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
mentallaeid
New Member

Retrieve a subset based on user selection

Hello,

 

I am working on a very large dataset (approx. 20GB) on SQL and I was wondering if it is possible to retrieve a subset of this dataset based on user selection in Power BI. For example, if the user selects ID number = 1 in a slicer, I want to be able to get all the rows from my SQL database that have ID number = 1.

 

Any help would be appreciated.

 

Regards,

7 REPLIES 7
smpa01
Community Champion
Community Champion

@mentallaeid I ran into same issue a while ago where I had to put a dynamic filter into SQL custom query based on a parameter specified by me. You can check the following link.

 

https://community.powerbi.com/t5/Desktop/POWER-Query-SQL-Statement-Dynamic-Filtering-based-on-a-diff...

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

@parry2k @smpa01 Thank you for your quick answers.

 

And is there a way to dynamically change the parameter's value or any other way of retrieving the subset? I need to be able to do that without editing the query.

 

Regards,

@mentallaeid I have answered similar question few days ago, in one of the reply on this post, solution is attached. You can use the similar approach to make it dynamic.

 

Basically you can have parameters in an excel sheet and then you can use that excel sheet to filter your query.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2kI don't think that will work in my case. Maybe I wasn't very clear on what I want to do. Basically, I created an histogram visual using Direct Query and based on this visual I want to select one or several IDs (on a slicer) which will then filter a line chart so that I can analyze my data on a more detailed level. The issue here is that I only need a subset of my large dataset to visualize my line chart, therefore I want to retrieve the subset of the IDs I selected to be able to get my visualization. My idea was then to use the selected IDs to filter the data in an SQL query and retrieve the subset as a result. Is that possible with Power BI desktop? Does your suggestion solve this problem? I'm pretty new to Power BI so if I didn't understand your approach and it actually solves my problem please let me know 🙂

Afaik it is not possible. Wish you had mentioned this In your initial post.


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2koh.. thank you for your help though 

parry2k
Super User
Super User

@mentallaeid you can achieve this using by creating parameter but not thru slicer.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.