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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jug
Frequent Visitor

User-entered field filter information

Is it possible to use directquery with a query that indicates that one of the filters of the fields selected in "where" must be indicated by the user, varying in each request? e.g. ... Where Client ID="user-entered"

1 ACCEPTED SOLUTION

 

If you're using Direct Query then there IS NO import. The data is not imported to the data model at all. The data is requested from the source at the point of visualisation, with any page slicers, measure filters, visual contexts etc. all being included in the WHERE clause of the Direct Query.

 

From MS Learn:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery 

 

BA_Pete_0-1671174287459.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @Jug ,

 

Just put [Client ID] into a slicer on the report page so the user can select the one they want.

Power BI will add this value to the WHERE clause in the Direct Query to the source, that's how DQ works.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Jug
Frequent Visitor

Thank you, but from what I understand this would only be possible after the import. I wanted to know if it would be possible to put it already in the sql query at the time of import, so that I could use a field in the query that asks for user input so that BI can import with a filter.

 

I had this doubt because the sql query has a lot of complex relationships between the tables, without unique keys, so importing through the sql code would be a faster solution than doing all the table relationships in BI. Besides that, I would need to make an input field in the SQL query as it would be a report used several times, but changing, for example, the client's code to bring in the report only the information of one client at a time.

 

 

 

If you're using Direct Query then there IS NO import. The data is not imported to the data model at all. The data is requested from the source at the point of visualisation, with any page slicers, measure filters, visual contexts etc. all being included in the WHERE clause of the Direct Query.

 

From MS Learn:

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery 

 

BA_Pete_0-1671174287459.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.