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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Nahel88
Frequent Visitor

Copy Query

I have the following example of my data :

Col1        Col2                                                        Col3        Col4

s               1                                                               s             1

q              2                                                               q             2 

d                                                                                f             3

f               3                                                                h            4 

g

h              4 

j

 

 and i want to get only the rows that both Col1 and Col2 are existin other words Col3 and Col4. I need the Query to get such a result sorry im not that good in writing queries but im in need to get this one. 

 

1 ACCEPTED SOLUTION
Baskar
Resident Rockstar
Resident Rockstar

Hi buddy,

I will give you two ways
1. from Query editor.
Original TableOriginal Table









Using Filter to remove NullUsing Filter to remove NullModelling TableModelling Table


2. From Development Canvas

Table ViewTable ViewRemove the check mark inRemove the check mark inOr else Choose in filter "is not Blank"Or else Choose in filter "is not Blank"

View solution in original post

8 REPLIES 8
Baskar
Resident Rockstar
Resident Rockstar

Hi buddy,

I will give you two ways
1. from Query editor.
Original TableOriginal Table









Using Filter to remove NullUsing Filter to remove NullModelling TableModelling Table


2. From Development Canvas

Table ViewTable ViewRemove the check mark inRemove the check mark inOr else Choose in filter "is not Blank"Or else Choose in filter "is not Blank"

carinat
Advocate I
Advocate I

Do you want to keep col 1 and 2 or could you simply just filter out blank values in both columns?

I think Nahel wants to remove blanks values from columns 1 and 2 in order to obtain something similat columns 3 and 4.

 

Create your table with columns 1 and 2, under Filters (right pane), expand column 2 and select is not blank, apply the filtering and this should remove all blank values.

wonga
Continued Contributor
Continued Contributor

@Nahel88

 

Assuming columns 1 and 2 are one table and columns 3 and 4 are another table:

 

You can probably use the "Merge Queries" feature in Query Editor and select the common column between the two tables and the result will be only what's common between the two.

 

If my assumption is incorrect, please provide more context/information as to what you want to achieve.

Nahel88
Frequent Visitor

ya but merge only works with mached type columns and those are two different types so , i dont think thats ganna work 


@Nahel88 wrote:

ya but merge only works with mached type columns and those are two different types so , i dont think thats ganna work 


@Nahel88

 

According to the snapshots in your original post, I think you can conform the columns to same consitent data types. Afterwards, merge the queries.

Capture.PNG

Baskar
Resident Rockstar
Resident Rockstar

Hi Nahel let me know , what is the output u excpecting ?

the Col3 and Col4 so a 2 new Columns 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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