Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
bdl5119
Advocate I
Advocate I

Making custom visualization using R and Plotly in PowerBI Desktop

I am reproducing the example in this link. Here is the code I am using in the script.r file: 

 

 

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
####################################################

################### Actual code ####################


p <- Values %>%
  plot_ly( x = ~x_data, y = ~y_data, z = ~z_data) %>%
  add_markers() %>%
  layout(scene = list(xaxis = list(title = 'X [mm]'),
                      yaxis = list(title = 'Y [mm]'),
                      zaxis = list(title = 'Z Number')));

internalSaveWidget(p, 'out.html')
# ####################################################  
# 
# ################ Reduce paddings ###################
ReadFullFileReplaceString('out.html', 'out.html', ',"padding":[0-9]*,', ',"padding":0,')
# ####################################################

 

 

I have managed to reach step 10 with no issues. After adding my data elements, I always get an error stating that x_data not found.

The screenshot is shown below: 

screenshot.png

 

I have found this post from 2019 with the same issue but no solutions have been posted. 

 

Can someone say what is going wrong here? 

Is there any way to debug and perhaps "print" the values being used by the visualization? 

 

Thanks in advance,

 

 

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @bdl5119 

As stated in the documentation you mentioned, you need to always make sure that the data elements should match the columns that were originally selected in the custom script.R file.
If the issue still persist, you'd better create a support ticket and have an MS engineer on your side to investigate the issue.

https://powerbi.microsoft.com/en-us/support/ 

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.