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
Anonymous
Not applicable

SQL IN parameter from the existing column in Power BI table

Hi All,

 I am excuting the SQL IN query from SAP Database and rather than manually enter the IN data (e.g. mobile numbers) and then refresh the table, I want the SQL IN to automatically pick up the data from a column(mobile number) present in existing table(table 2) in same Power BI desktop.

 

Eg. 

Select * from table 1

where field3 IN ( mobile number from table 2)

 

table 2

Mobile number

111111111

222222222

333333333

444444444

555555555

 

3 REPLIES 3
Anonymous
Not applicable

My Table 1 is an SQL IN function from external database and it should pick up the IN data from the existing data in POwer BI desktop which is from different source.

ThxAlot
Super User
Super User

Calculated Table = 
FILTER(
    Table1,
    NOT ISEMPTY(
        FILTER( Table2, Table2[Mobile number] = Table1[Field3] )
    )
)

 

In terms of SQL in your scenario, EXISTS() is more efficient than IN

SELECT *
FROM Table1
WHERE EXISTS(
    SELECT NULL FROM Table2 WHERE Table2.[Mobile number] = Table1.Field3
)


Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Anonymous
Not applicable

What is the this used for Calculated Table = FILTER( Table1, NOT ISEMPTY( FILTER( Table2, Table2[Mobile number] = Table1[Field3] ) ) ) Can we use Dynamic M Parameter. If yes, can you please show step by steps

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!

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.