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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.