Hi,
In order to use R Visuals you need to first install R and enable it in Power BI Desktop
Follow these steps to use R Visuals in Query Editor:
Step 1:
• Load your data into Power BI Desktop
• Get Data > CSV from the Home ribbon in Power BI Desktop
Step 2:
• Select the file and Select Open
• CSV file is displayed in the CSV file dialog
Step 3:
Once the data is loaded you will be able to see it in the Fields pane in Power BI Desktop
Step 4:
Open Query Editor by selecting Edit Queries from the Home tab in Power BI Desktop
Step 5:
In Transform tab, select RUN R Script and the Run R Script editor appears
Step 6:
Enter your R Script in the R Script Editor
Note: You will need mice library installed in you R environment for your script code to work properly
library(mice)
tempData <- mice(dataset,m=1,maxit=50,meth='pmm',seed=100)
completedData <- complete(tempData,1)
output <- dataset
output$completedValues <- completedData$"SMI missing values"
Step 7:
After selecting OK, Query Editor displays a warning about data privacy
Step 8:
For R Scripts to run properly, all the data sources must be public
Now you can finally create your own visualizations depending upon your dataset.
Hope This Helps!!