This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello everyone,
we all love sankey charts. I want to draw a simpel sankey. It turns out the data prep isnt that simple after all. Can you help?
The incoming data looks like this:
| Channel | Website | Conversion | Sales |
| ProductSite_A | Download | 5000 | |
| ProductSite_A | Contact | 15000 | |
| ProductSite_B | Subscription | 1000 | |
| ProductSite_B | Contact | 500 | |
| ProductSite_A | Contact | 3000 | |
| ProductSite_B | Download | 6000 | |
| ProductSite_B | Subscription | 9000 | |
| ProductSite_B | Contact | 700 | |
| ProductSite_C | Download | 1400 |
I know I have to transform the data in a way, that I get a column for source and one for target (one extra for the occurcances) and after all the value of sales needs to be calculated for this as well. Does anyone have a clou? I am freaking out on this.
The final table should look a little like this.
| Source | Target | Occurs | Sales |
| ProductSite_A | 2 | ? | |
| ProductSite_B | 2 | ? | |
| ProductSite_A | 1 | ? | |
| ProductSite_B | 3 | ? | |
| ProductSite_C | 1 | ? | |
| ProductSite_A | Download | 1 | ? |
| ProductSite_A | Contact | 2 | ? |
| ProductSite_B | Subscription | 2 | ? |
| ProductSite_B | Contact | 2 | ? |
| ProductSite_B | Download | 1 | ? |
| ProductSite_C | Download | 1 | ? |
Solved! Go to Solution.
Hi @raymond,
You could create a calculated table with below formula:
Table =
UNION (
SUMMARIZE (
SELECTCOLUMNS ( Data, "Source", Data[Channel], "Target", Data[Website] ),
[Source],
[Target],
"Occurs", COUNT ( Data[Sales] ),
"Sales", SUM ( Data[Sales] )
),
SUMMARIZE (
SELECTCOLUMNS ( Data, "Source", Data[Website], "Target", Data[Conversion] ),
[Source],
[Target],
"Occurs", COUNT ( Data[Sales] ),
"Sales", SUM ( Data[Sales] )
)
)
Best regards,
Yuliana Gu
Hi @raymond,
You could create a calculated table with below formula:
Table =
UNION (
SUMMARIZE (
SELECTCOLUMNS ( Data, "Source", Data[Channel], "Target", Data[Website] ),
[Source],
[Target],
"Occurs", COUNT ( Data[Sales] ),
"Sales", SUM ( Data[Sales] )
),
SUMMARIZE (
SELECTCOLUMNS ( Data, "Source", Data[Website], "Target", Data[Conversion] ),
[Source],
[Target],
"Occurs", COUNT ( Data[Sales] ),
"Sales", SUM ( Data[Sales] )
)
)
Best regards,
Yuliana Gu
Hi @v-yulgu-msft that works pretty good I have to say. The Sum of Sales needs to be divided by 2 though otherwise you would double the amount of sales.
Another question: is there a way to do this in power query as well. I was thinking it might cause some performance issues if I am using a calculated table. Is my concern ligitimate?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 23 | |
| 22 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 28 | |
| 22 | |
| 22 |