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
Rjesak
Helper I
Helper I

filter and create relationships before loading data

I think this is a very basic question but I've been searching and not found an answer so I'm going to try.

 

We have two rather large tables that are connected by a 1:many relationship through a unique sequence number. I wrote a SQL query to select the filtered set of the parent table along with the related supporting records but that creates a single really large table with lots of duplicate data.

 

I'd rather build this as a model (parent table with a relation to the supporting table) but if I don't filter the supporting table based on the connection to the parent table, it's too large.

 

I know I can do this but I can't for the life of me figure out how.

1 ACCEPTED SOLUTION
AiolosZhao
Memorable Member
Memorable Member

Hi @Rjesak ,

 

Do you have mean you want to create two tables in power bi finally?

The problem is that you want to limit the parent table and limit the supported table(based on parent table), right?

And your query get one table with all duplicated records after using the "parent" limitation.

 

If yes, I think you can create the parent table by:

select xxx

from parent_table

where limitation

 

and for support table:

select xx

from support table

inner join parent_table

where parent_limitation

 

If I'm wrong, please show me what you want more clearly, if you have sample data that will be better.

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
AiolosZhao
Memorable Member
Memorable Member

Hi @Rjesak ,

 

Do you have mean you want to create two tables in power bi finally?

The problem is that you want to limit the parent table and limit the supported table(based on parent table), right?

And your query get one table with all duplicated records after using the "parent" limitation.

 

If yes, I think you can create the parent table by:

select xxx

from parent_table

where limitation

 

and for support table:

select xx

from support table

inner join parent_table

where parent_limitation

 

If I'm wrong, please show me what you want more clearly, if you have sample data that will be better.

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.