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
tap_ks
Regular Visitor

Get filtered data from SQL database

How can we limited data from a huge table reside in SQL Servere database?

 

We used WHERE clause in SQL Server. Do we have similar command in Power BI while pulling the required data?

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Hi @tap_ks,

 

In your scenario, you should be able to import all the tables one by one, by running corresponding native database queries against the same database each time. Smiley Happy

 

Regards

View solution in original post

5 REPLIES 5
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @tap_ks,

 

As mentioned by JoeCham above, you can directly run native database queries against the database using Power Query in your scenario. For more details about importing Data from Database using Native Database Query (Power Query), you can refer to this article. Smiley Happy

 

Regards

JoeChamp
Frequent Visitor

I'm working on the report, trying to add a measure.  The dashboard reference is to the data, the data set is the Audit Log data from the Office admin portal pulling dashboard views. 

 

I'm looking for a measure that will count the users that exceeded a count of 50 views on the dataset.  I have a metric that counts the views and displaying that fine on the report.  Now I'm looking for a way to count the number of users who have >50 views.  I can build a bar chart of the users and their views and filter that for >50, but I'm looking for a way to count them and show that count on a card visual.

JoeChamp
Frequent Visitor

You can use custom SQL including your where.  Just after choosing SQL server from Get Data, on the same screen as your server/database attributes, click the Advanced options and put your SQL into the SQL statement field.

 sql input.jpg

I need to pull from multiple tables e.g. from Customer, Orders, Items, Products tables separately. Then wants to buils a relationship.

 

How to do so?

 

Thanks in advance.

 

Hi @tap_ks,

 

In your scenario, you should be able to import all the tables one by one, by running corresponding native database queries against the same database each time. Smiley Happy

 

Regards

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.