Microsoft Certified: Power BI Data Analyst AssociateVisualize and analyze the dataHard
A manufacturing company uses Power BI to monitor production efficiency. The report includes a gauge visual showing the current efficiency score against a target, and a line chart tracking efficiency over time. The company wants to integrate an external R script that performs a more complex statistical anomaly detection on the efficiency data and displays the results directly within the Power BI report. How can the data analyst achieve this?
- AConnect to an R data source using Power Query.
- BUse the 'R visual' built-in visual type and paste the script.
- CEmbed the R script directly into a DAX measure.
- DImport the R script as a custom visual from AppSource.
Show answer & explanationAnswer & explanation
Correct answer: B. Use the 'R visual' built-in visual type and paste the script.
Power BI has a built-in 'R visual' type that allows users to write and execute R scripts directly within the report. The script can consume data from the Power BI model and produce a visual output that is rendered on the report canvas. This is the most direct way to integrate custom R-based visualizations or statistical outputs.
Why the other options are wrong
- A. Connecting to an R data source via Power Query would execute an R script to *load and transform data*, not to create a visual directly within the report canvas based on existing model data.
- C. DAX expressions are for data modeling and calculations, not for embedding and executing R scripts to generate visuals. While DAX can call R in some contexts (e.g., Power Query), it's not for direct visual integration this way.
- D. While some R-based visuals might be available on AppSource, the requirement is to use *an external R script* directly, not a pre-built custom visual.
Power BI R Visual
A native Power BI visual type that enables users to execute R scripts within the report, using data from the Power BI model as input and rendering the script's visual output on the report canvas.
- Requires R installation on the local machine.
- Uses data from the Power BI model as input.
- Allows for custom R-based visualizations and statistical analysis.
Memory trick: R scripts can visualize, right in Power BI's sight, complex analysis, shining ever bright.