Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm using the R script editor to make some custom visualizations in a PBI report and I'm wondering if it's possible to add PBI measures to the dataframe that you make in the R script - i.e., so my resulting data frame would be one row long and every column would be the value of a different DAX-calculated measure. I've tried to do this with a simple measure (a proportion) but when I display the value on my R visualization it appears to be gibberish numbers.
Are measures something that you can incorporate into this kind of thing, or would you need to calculate them again within the R script?
Solved! Go to Solution.
Hi @jd_87
Only data frames are imported to the R, remember to represent the data you want to import to Power BI in a data frame, you need to calculate them again within R script, the language of measure cannot support in R script., you can refer to the following link.
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-r-scripts#prepare-an-r-script
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jd_87
Only data frames are imported to the R, remember to represent the data you want to import to Power BI in a data frame, you need to calculate them again within R script, the language of measure cannot support in R script., you can refer to the following link.
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-r-scripts#prepare-an-r-script
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
So, I've given this another shot, and it actually seems like you CAN work with measures in R - at least as long as the dataframe you're making in R is just a collection of measures.
For instance, if I add a series of PBI measures to my R visual, I can refer to them each individually (e.g., dataset[1,1], dataset[1,2], etc.), which is what I want. I'm not sure why the numbers weren't displaying correctly when I tried this the first time, but it seems to be working fine now 🙂
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 46 | |
| 44 | |
| 28 | |
| 19 |
| User | Count |
|---|---|
| 199 | |
| 129 | |
| 102 | |
| 69 | |
| 55 |