Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"


0 (0 Likes / 0 Dislikes)
  • Embed Video

  • Embed normal player Copy to Clipboard
  • Embed a smaller player Copy to Clipboard
  • Advanced Embedding Options
  • Embed Video With Transcription

  • Embed with transcription beside video Copy to Clipboard
  • Embed with transcription below video Copy to Clipboard
  • Embed transcript

  • Embed transcript in:
    Copy to Clipboard
  • Invite a user to Dotsub
If you're a data scientist, you might be familiar with a package called R. This is a really common application that data scientists use to do very deep analytical and statistical analysis over data. It's also a really good visualization platform. And what we did with Power BI Desktop was allowed you to integrate with R to go and say, "Okay we'll use some of the packages "and some of the visualizations that are available in R but host those within the Power BI Desktop report." That means that you can send data that's within your Power BI Desktop file over to R, get R to generate some visuals or run some script against that data, and then bring it back into the report and use it on the canvas just like any other visual. Let's take a look at how that works. I've got a desktop report here with some data already loaded. In this case, we're looking at different models of car and then some stats around kind of the number of carburetors, the number of cylinders, the engine size, et cetera, et cetera. Let's just add a table just so you can see the sort of data I'm talking about. It's just some simple numeric data. What we're going to do here is actually look at the correlation between all of these different metrics for each car. Maybe there's some correlation between things like the miles per gallon or the horsepower compared to the number of cylinders, for example. So to create an R visual, all I need to do is choose that from the visualizations pane. It'll get added to the canvas just like anything else. And you'll see at the bottom of the window there's an R script editor that gets generated. Now because of the way that we zoomed in in this video, it takes over a whole lot of the screen. If you're using a larger screen resolution, you wouldn't see this. Or at least it wouldn't take up so much space. But you can see to get started we need to start adding some fields into the values area of the field well. So let's just pick the fields that we're interested in. I'm going to add one of these ones down here. And you can see them being added to the field well here on the right-hand side. And you can see in the script editor we're actually starting to build some of the R script up. These are just some commented outlines. This is some work that we do behind the scenes to create a data set which is the unit of data that R operates over. And we're doing it by passing in all of the different fields that we selected from our model. And then down at the bottom I can start pasting or typing in my R script. I've got some that I already typed up before. And you can see what we're doing is we're using a correlation plot library that I downloaded and installed from the web. We're converting our data set into a matrix. That's what the correlation plot library uses. And you can see here this is the line that actually generates our correlation plot. So it uses that matrix. And then there are some parameters that just change the way that that visual looks. So now I want to hit run. What's going to happen is we're going to take that data from the Power BI Desktop, send it to my local installation of R, run this script, get a visual back, and put that onto the Power BI canvas. So there you go. That happened pretty quickly. It's taken that data, sent it over to R, and I've brought the visual back in. And you can see we've got some correlations shown in this visual, so there's obviously a really high correlation between the individual fields. But you can see the blue one's a high correlation. The red ones are lower. I can come back and edit that script further. So I've got a few different examples here. I've just commented out some different lines that just render the correlation plot in a slightly different way just changing some of the parameters for that. So I'll hit run, it renders, and now we get one with circles instead of squares. And the size of the circle is indicated in the correlation too. But because this is just a visual on the Power BI Desktop canvas, it works like any other visual. So I can resize it. I can move it around. But it's also interactive like any other visual. So I'm going to create a little doughnut chart, and let's just add whether or not this car was a sports car and just do a count of the number of sports cars. So we can see that we've got a few more sports cars than we have—sorry, a few fewer sports cars— than we have non-sports cars. But now when I start selecting and interacting with these visuals, the R visual will get updated as well. So if I want to focus and look just at the sports cars, when I click on that you'll see the R visual gets updated and it gets filtered down to show just the data for those cars. Compare that to the non-sports cars, and you can see it's re-rendering as I interact with that data. So in the same way that we would have filtered or re-highlighted any other visual when I interact with it, the R visual has the data filter damp, gets sent back to R. The visualization gets rendered again and gets sent back to the Power BI Desktop. And I've taken that same desktop file and published it up to the Power BI service. You can see I get exactly the same R visual rendered here. And it remains interactive, as well. Effectively what we've got is a version of R running in our service as well that allows you to keep re-querying this data. And as data refreshes in this service, it'll be updated and all these visuals can react to that as well. So it's a really simple way that you can use R to enhance your Power BI reports using the huge library of visualizations that are available, using all the scripts that you might find on the Internet to go and manipulate your data, visualize it in different ways, and then share that with other folks around your organization just as you would do any other Power BI report. I can save this report and do anything else that I would normally do with a Power BI Desktop report. So it's a really easy way to integrate with that R package and use any of the visuals or statistical analysis that are available through R right there in the Power BI Desktop.

Video Details

Duration: 7 minutes and 1 second
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 5
Posted by: csintl on Dec 10, 2016

----- (Please provide translations for these languages: Chinese (Simplified) (chi_hans), Chinese (Traditional) (chi_hant), English (eng), French (France) (fre_fr), German (ger), Italian (ita), Japanese (jpn), Korean (kor), Portuguese (Brazil) (por_br), Russian (rus), Spanish (spa).)

Caption and Translate

    Sign In/Register for Dotsub to translate this video.