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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.