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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter SQL Based on Value from table

Hi

 

I have two tables. One has a field called "LastMonth", and the other needs to be filtered by this field.

Both tables are on different servers, and there no way I can load the second table full, because it is really big.

 

Is there any way I can set a parameter based on the value of the field of first table, toto filter the second table before being loaded?

Table 1 / Server 1:

LastMonth | ManyFields...

201910      | ....

201910      | ....

...

 

Table 2 / Server 2

Month  | Many Fields...

201910 | ...

201909 | ...

201908 | ...

I need to filter this table based on the value of LastMonth with a parameter. 

 

Thanks!!

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could use Parameters in Power BI

https://www.mssqltips.com/sqlservertip/4475/using-parameters-in-power-bi/

and then just selected LastMonth column of Table 1, and right-click it choose "Add as a New Query"

5.JPG

Now when you create a new parameter, please choose "Suggested Values"

6.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could use Parameters in Power BI

https://www.mssqltips.com/sqlservertip/4475/using-parameters-in-power-bi/

and then just selected LastMonth column of Table 1, and right-click it choose "Add as a New Query"

5.JPG

Now when you create a new parameter, please choose "Suggested Values"

6.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
littlemojopuppy
Community Champion
Community Champion

Check this out...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors