Forum Discussion
snehasissamal
2 years agoFrequent Visitor
Sankey Chart Data model Preparation
Hi, I want to have a Sankey chart to display the budget Sector -> Directorate - Expenditure type i.e 2 level one How I can create a table to get the data in proper format for Sankey chart from o...
- Anonymous2 years ago
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi snehasissamal ,
Here are the steps you can follow:
1. Create calculated table.
True Table= var _table1= SUMMARIZE('Table',[Sector],[Directorate],"Budget", SUMX(FILTER(ALL('Table'),[Sector]=EARLIER('Table'[Sector])&&[Directorate]=EARLIER('Table'[Directorate])),[Estimated Budget]), "Level","1") var _table2= SUMMARIZE( 'Table',[Directorate],'Table'[Expenditure Type],"Budget", SUMX( FILTER(ALL('Table'), [Directorate]=EARLIER('Table'[Directorate])&& [Expenditure Type]=EARLIER('Table'[Expenditure Type])),[Estimated Budget]), "Level","2") return UNION( _table1,_table2)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
snehasissamal
2 years agoFrequent Visitor
Thanks lbendlin, Here is the data:
Original Data
| Year | Sector | Directorate | Description | Expenditure Type | Estimated Budget |
| 2024 | Sector A | Directorate AA1 | Project 1 | Locked | 10000 |
| 2024 | Sector A | Directorate AA1 | Project 2 | Spent | 2000 |
| 2024 | Sector A | Directorate AA1 | Project 3 | Remaining | 8000 |
| 2024 | Sector A | Directorate AA2 | Project 4 | Locked | 5000 |
| 2024 | Sector A | Directorate AA2 | Project 5 | Remaining | 2000 |
| 2024 | Sector B | Directorate BB1 | Project 6 | Locked | 50000 |
| 2024 | Sector B | Directorate BB1 | Project 7 | Spent | 25000 |
| 2024 | Sector B | Directorate BB1 | Project 8 | Remaining | 25000 |
| 2024 | Sector B | Directorate BB2 | Project 9 | Locked | 100000 |
Required Data Format
| Source | Target | Budget | Level |
| Sector A | Directorate AA1 | 20000 | 1 |
| Sector A | Directorate AA2 | 7000 | 1 |
| Sector B | Directorate BB1 | 100000 | 1 |
| Sector B | Directorate BB2 | 100000 | 1 |
| Directorate AA1 | Locked | 10000 | 2 |
| Directorate AA1 | Spent | 2000 | 2 |
| Directorate AA1 | Remaining | 8000 | 2 |
| Directorate AA2 | Locked | 5000 | 2 |
| Directorate AA2 | Remaining | 2000 | 2 |
| Directorate BB1 | Locked | 50000 | 2 |
| Directorate BB1 | Spent | 25000 | 2 |
| Directorate BB1 | Remaining | 25000 | 2 |
| Directorate BB2 | Locked | 100000 | 2 |