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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

do relations between two table

Hi,

I have a doubt of how can i do the next work in power bi desktop.

I have this two tables and i need to create relation between them.

1st table:

IDaccount rangedescription
1[655789..655795]sells to factory
2655432|655433|655434sells to client 
37568909buys to client

2nd table

IDaccountammount
1655790560€
2655789670€
37568909

1300€

 

I need to create a relation of account range (table 1) and account (table 2). The account range column can have the 3 next format:

- [655789..655795] This is a range of accounts (655789,655790,655791,655792,655793,655794,655795 are inside this range).

- 655432|655433|655434 only this 3 accounts are inside the group of sells to client.

- 7568909 is the only account of the group who buys to client.

 

How can i transform the table 1 to do relation with table 2. Any suggestion?

 

Regards

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , remove [ and ]

split the columns | into rows 

and slit the column with .. into two columns

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

 

 

Now where the value in null the second column copy the value from first column,

 

You will range for each column  (column 1, column 2)

 

 

then ty between join in power query

https://radacad.com/dates-between-merge-join-in-power-query

 

 

 

or crossjoin and filter in dax

 

filter(crossjoin(Table1,Table2), table2[account] >= Table1[Account1] && table2[account] <= Table1[Account2])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , remove [ and ]

split the columns | into rows 

and slit the column with .. into two columns

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

 

 

Now where the value in null the second column copy the value from first column,

 

You will range for each column  (column 1, column 2)

 

 

then ty between join in power query

https://radacad.com/dates-between-merge-join-in-power-query

 

 

 

or crossjoin and filter in dax

 

filter(crossjoin(Table1,Table2), table2[account] >= Table1[Account1] && table2[account] <= Table1[Account2])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak,

I understand what you say to me but this example is only for the case that the table one column have a range of accounts separated by .. . What appens when only have one account or 3 specific accounts separated by | the situation in this cases is different?

Regards,  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.