Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I want to prepare the following data to suit the Sankey needs. Can you please help with the wasy way of doing it.
Original Data
Layer 1 | Layer 2 | Layer 3 | Layer 4 | Layer 5 |
A | B | C | D | E |
AA | BB | CC | DD | EE |
AAA | BBB | CCC | DDD | EEE |
Expected data:
Source | Target | Weight |
A | B | 1 |
B | C | 1 |
C | D | 1 |
D | E | 1 |
AA | BB | 1 |
BB | CC | 1 |
CC | DD | 1 |
DD | EE | 1 |
AAA | BBB | 1 |
BBB | CCC | 1 |
CCC | DDD | 1 |
DDD | EEE | 1 |
What is the easiest way to prep the data like the one above? Thanks in advance.
Solved! Go to Solution.
Hi, try this
Table = UNION(SELECTCOLUMNS(table,"Source",Layer 1 column,"Target",Layer 2 column),
SELECTCOLUMNS(table,"Source",Layer 2 column,"Target",Layer 3 column),
SELECTCOLUMNS(table,"Source",Layer 3 column,"Target",Layer 4 column),
SELECTCOLUMNS(table,"Source",Layer 4 column,"Target",Layer 5 column)
)
It works great. Thanks for your response... The Exact code i used is given below.
Sankey = UNION(SELECTCOLUMNS(Test,"Source",[Layer 1] ,"Target",[Layer 2] ),SELECTCOLUMNS(Test,"Source",[Layer 2] ,"Target",[Layer 3]),SELECTCOLUMNS(Test,"Source",[Layer 3] ,"Target",[Layer 4] ),SELECTCOLUMNS(Test,"Source",[Layer 4] ,"Target",[Layer 5] ))
Hi, try this
Table = UNION(SELECTCOLUMNS(table,"Source",Layer 1 column,"Target",Layer 2 column),
SELECTCOLUMNS(table,"Source",Layer 2 column,"Target",Layer 3 column),
SELECTCOLUMNS(table,"Source",Layer 3 column,"Target",Layer 4 column),
SELECTCOLUMNS(table,"Source",Layer 4 column,"Target",Layer 5 column)
)
It works great. Thanks for your response... The Exact code i used is given below.
Sankey = UNION(SELECTCOLUMNS(Test,"Source",[Layer 1] ,"Target",[Layer 2] ),SELECTCOLUMNS(Test,"Source",[Layer 2] ,"Target",[Layer 3]),SELECTCOLUMNS(Test,"Source",[Layer 3] ,"Target",[Layer 4] ),SELECTCOLUMNS(Test,"Source",[Layer 4] ,"Target",[Layer 5] ))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
121 | |
79 | |
48 | |
38 | |
31 |
User | Count |
---|---|
192 | |
79 | |
70 | |
50 | |
42 |