Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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:
| ID | account range | description |
| 1 | [655789..655795] | sells to factory |
| 2 | 655432|655433|655434 | sells to client |
| 3 | 7568909 | buys to client |
2nd table
| ID | account | ammount |
| 1 | 655790 | 560€ |
| 2 | 655789 | 670€ |
| 3 | 7568909 | 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
Solved! Go to Solution.
@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])
@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])
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,
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |