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:
• Load your data into Power BI Desktop
• Get Data > CSV from the Home ribbon in Power BI Desktop
• Select the file and Select Open
• CSV file is displayed in the CSV file dialog
Once the data is loaded you will be able to see it in the Fields pane in Power BI Desktop
Open Query Editor by selecting Edit Queries from the Home tab in Power BI Desktop
In Transform tab, select RUN R Script and the Run R Script editor appears
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
tempData <- mice(dataset,m=1,maxit=50,meth='pmm',seed=100)
completedData <- complete(tempData,1)
output <- dataset
output$completedValues <- completedData$"SMI missing values"
After selecting OK, Query Editor displays a warning about data privacy
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!!