Forum Discussion
students migration by multi-level sankey graph
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 |
- Anonymous1 year ago
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 KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- MNedix
Solution Sage
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.
- MNedix
Solution Sage
Then just watch that YT video and you should be alright.
- AnonymousNot applicable
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 KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- juddinNew Member
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.