Installation and configuration
To use R within Power BI, you must first install an R distribution for you to run and execute scripts against. In this book, we will leverage Microsoft's distribution, Microsoft R Open. It is an open source project and free for anyone to use. Once Microsoft R Open has been installed, you can then configure Power BI to recognize the home directory where R libraries may be installed. Let's walk through these setup steps together:
- Navigate to the website https://mran.microsoft.com/download/ to download and install Microsoft R Open.
- For the purposes of our example, you will select Download next to Microsoft R Open for Windows.
- Once the download has completed, run the installation and accept all default settings and user agreements.
- Next, launch a new instance of the Power BI Desktop to set up the R integration with Power BI. Click the menu options File | Options and settings | Options.
- Choose the R scripting section and ensure that the Detected R home directories property is filled with the R instance you just installed:
![](https://epubservercos.yuewen.com/644FAD/19470384001518306/epubprivate/OEBPS/Images/007a10ed-12a8-4b3f-9563-8d8ca789ff7a.png?sign=1739302676-HByGqinAcde0QOaO6C6dXaLm6yH7lrxI-0-f75c41a8463674fe8759992a153a1ea5)
- Once this is completed, click OK to begin using the capabilities of R within Power BI.