Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
I did data transform by creating a new table with DAX, and the format of new table is sankey format: Source, Target, Occurs(Please refer to below table1)
Table1:
Then I trying to create sankey diagram with R visulization, here is the script:
dataset <- data.frame(Source, Target, Occurs) dataset <- unique(dataset) library(networkD3) dataset$Source = as.character(dataset$Source) dataset$Target = as.character(dataset$Target) Sankeylinks<-dataset Sankeynodes<-data.frame(name=unique(c(Sankeylinks$Source,Sankeylinks$Target))) Sankeynodes$index<-0: (nrow(Sankeynodes) - 1) Sankeylinks<-merge(Sankeylinks,Sankeynodes,by.x="Source",by.y="name") Sankeylinks<-merge(Sankeylinks,Sankeynodes,by.x="Target",by.y="name") Sankeydata<-Sankeylinks[,c(4,5,3)]; names(Sankeydata)<-c("Source","Target","Occurs") Sankeyname<-Sankeynodes[,1,drop=FALSE] # draw sankey network sankeyNetwork(Links=Sankeydata,Nodes=Sankeyname,Source="Source",Target="Target",Value="Occurs",NodeId="name",fontsize=8,nodeWidth=20)But there is error occured.
Hi,
The error on your picture says that field name is unavailable.
Please check that you correctly typed all your fileds names.
Also, pay attention please that using fileds must be added to "Values" bucket to be available in a script regarding this article.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |