Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have shared a sample data of students major migration. How can I organize this given data and create sankey graph on power Bi? seeking your help. thank you.
| ID | TERM | Major |
| 1 | 2020 | Literature |
| 1 | 2021 | History |
| 1 | 2022 | History |
| 1 | 2023 | Biology |
| 2 | 2021 | History |
| 2 | 2022 | History |
| 2 | 2023 | History |
| 2 | 2024 | Literature |
| 3 | 2022 | Biology |
| 3 | 2023 | Biology |
| 3 | 2024 | Biology |
| 4 | 2023 | Biology |
| 4 | 2024 | Math |
| 5 | 2024 | Math |
| 6 | 2022 | Math |
| 6 | 2023 | Biology |
| 6 | 2024 | Computer |
| 7 | 2024 | Computer |
| 8 | 2020 | Literature |
| 8 | 2021 | History |
| 8 | 2022 | History |
| 8 | 2023 | Biology |
Solved! Go to Solution.
Hi @juddin ,
When creating a Sankey diagram in Power BI, you need to prepare a data table that contains these fields. For example, if you are tracking students' major migration, your data table might need to contain the students' IDs, their original majors (source), the majors they transferred into (destination), and the number of students who migrated in each semester (weight).
I did the following with the data you provided and create below measure, then created a Sankey chart based on it.
Migration Weight = COUNTROWS('Test')
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @juddin ,
When creating a Sankey diagram in Power BI, you need to prepare a data table that contains these fields. For example, if you are tracking students' major migration, your data table might need to contain the students' IDs, their original majors (source), the majors they transferred into (destination), and the number of students who migrated in each semester (weight).
I did the following with the data you provided and create below measure, then created a Sankey chart based on it.
Migration Weight = COUNTROWS('Test')
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. It seems colse to my expectation. How did you sort out Destination column. My original dataset is too big. It is not possible to do manually. In addition, Blue line at right side showing no major.
Then just watch that YT video and you should be alright.
Heya,
Do you (already) have a work or student Microsoft account? You can't really add the Sankey without one of those.
Check this YT: https://www.youtube.com/watch?v=T7lVEk9pWY8
Hope it helps.
Thank you. But this is not right tutorial, I am expecting
yes. I have student account. I want to create multi-level sankey graph
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |