Forum Discussion
raymond
7 years agoPost Patron
Prepare Data for Sankey Chart
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...
- 7 years ago
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
v-yulgu-msft
7 years agoMicrosoft Employee
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