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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

@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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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