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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sskoushik
New Member

Filtering columns from different sheets Say 2 excel sheets.

Hello.

I am new to PowerBI, I am trying to filter two same  columns from two different sheets. How can I do that. Let me explain you my problem clearly.

say for example I have two excel sheets T1 and T2.

T1                          T2

C1    C2                 C1       C2   C3   C4

134  245               134     245 .......   .......

123  345               123    345  ......    ......

234  453               234     453  .......   .......

 

if c1 and c2 from T1 is equal to c1 and c2 in T2, then i want the complete row if it matches.If that doesnt match then leave that and continue. Is there any possibility for doing this operation?

Thanks in advance.

Sumanth.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @sskoushik,

 

Suggestion1: In query editor mode

In this case we want to merge queries. From the left pane of Query Editor we select the query into which we want the other query to merge. Then select Merge Queries -> Merge Queries as New from the Home tab on the ribbon.
1.PNG

2.PNG

 

Then, you will get a new merged table combining the original two tables, now you can delete some unnecessary columns and rename columns.

 

Suggestion2: Using DAX

Apart from combining tables in Query Editor, we can create a new calculated table in visual mode. Please refer to below DAX formula:

T3 =
CALCULATETABLE (
    T2,
    FILTER (
        T2,
        LOOKUPVALUE ( T1[C1], T1[C1], T2[C1], T1[C2], T2[C2] ) <> BLANK ()
    )
)

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @sskoushik,

 

Suggestion1: In query editor mode

In this case we want to merge queries. From the left pane of Query Editor we select the query into which we want the other query to merge. Then select Merge Queries -> Merge Queries as New from the Home tab on the ribbon.
1.PNG

2.PNG

 

Then, you will get a new merged table combining the original two tables, now you can delete some unnecessary columns and rename columns.

 

Suggestion2: Using DAX

Apart from combining tables in Query Editor, we can create a new calculated table in visual mode. Please refer to below DAX formula:

T3 =
CALCULATETABLE (
    T2,
    FILTER (
        T2,
        LOOKUPVALUE ( T1[C1], T1[C1], T2[C1], T1[C2], T2[C2] ) <> BLANK ()
    )
)

 

Best regards,
Yuliana Gu

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.