Forum Discussion
Direct Query with Parameter to SQL
- 4 years ago
I'm saying that you don't have to parameterize it yourself. With DirectQuery, Power BI will automatically query your SQL source using the filters you've applied as part of the query.
I'd recommend this article for more detailed information on DirectQuery:
https://radacad.com/directquery-connection-in-power-bi-how-does-it-work-limitations-and-advantages
Thank you for your reply. I can definitely add a slicer for CustomerID. What I am trying to solve is how to pass that value to the direct query so that it only pulls back one customer's data in the SQL call. I do not want to bring over the entire customer transaction file because it would be enormous. Can you help me with having the SQL call only pull back one customer's data? AlexisOlson
Enforce single select on the slicer and it should only pull one.
- dkernen4 years ago
Resolver II
I am sorry, but I just don't understand. Here is a very simple sample file. (CustomerID = Referral_ID). How do I make the value of the slicer as my Referral and have my direct query use that as a parameter for the SQL call? AlexisOlson
https://mwtn-my.sharepoint.com/:u:/g/personal/dkernen_mwtn_org/ERhNpctEl3lCr47sFvB6fC0BG8l0B6ezoU4ZkQeJiWhhHQ?e=baWxXk- AlexisOlson4 years ago
Super User
I'm saying that you don't have to parameterize it yourself. With DirectQuery, Power BI will automatically query your SQL source using the filters you've applied as part of the query.
I'd recommend this article for more detailed information on DirectQuery:
https://radacad.com/directquery-connection-in-power-bi-how-does-it-work-limitations-and-advantages- beaumokrane3 years agoNew Member
Hello all, I have a similar situation. I use a directQuery with parameters. To simplify to only one, it's a transaction ID and the database can have up to 10000 entries a day and about 15 years of data , so loading all of them into a slicer is not something I am condering because high volume of data for no reason. The ideal solution, given the fact that users know which transaction they want, would be a simple dialog with an input box and a "GO" button. It doesn't seem possible to do this with Power BI. My transaction ID is in the form of: YYYYMMDDnnnn where nnnn is from 1 to 9999. So I created 2 slicers one for the day and one for the ticket. This way I don't have to load all the tickets. The way I see it working is the user would select one entry from each slicer, I would capture that and concatenate the 2 selections into a measure and pass that to my query. I'm new with PBI and I have been struggling with this for while. The challenge is to find a simple way to update the parameter from a measure or a visual. Any suggestions would be great? Thank you in advance.
- 2014aniruddha11 months agoFrequent Visitor
Hi
Have you got the solution for this? I have also same requirement. I can't load the full fact table due to huge volume. Hence I want that to be in direct query mode where say product filter will have a product_parameter which will run the query based on that product_parameter value selcted by the user at front end.
I have showed the parameter product_parameter as filter slicer (show as value), now whatever value user will select in that filter , i want that value to passed to the direct query on the fact table and fetch the data for that filtered value.
Any help please on this.
Many Thanks
Ani