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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I recently started using PowerBI. I come from R and I have found the modelling capabilities very nice.
In this occasion, I want to create Calculated Tables using R scripts. Either that, or calling data sources within the R transform in the Query Editor. I haven't found the way to do it. I have only been able to use the R scripts on new data sources.
For example,
I am connecting to a database and calling a table Cars.
Then I want to create a new table called Inventory Weekly based on Cars with an R script.
And then I can create a PowerBI visual from the result of that.
I see three solutions:
1. The preferred solution is the one I need most help with: call the Cars datasource and modify it in an R script. Thus creating Inventory Weekly but keep Cars source independent.
2. I can manage to create a new source in which Cars is recalled and modified to target Inventory Weekly, with an R script.
The problem with this is that I have to load Cars twice as a source, and I'd rather just build on top of it.
3. Attempt to translate R code to DAX, so that I can modify this in place, as I've found is the recommended way to do it. This is the best long term solution, but doesn't adjust to my present needs because there's a steep learning curve with DAX.
Thanks
Solved! Go to Solution.
Create your Cars query. Create another query that references that query. You can then insert an R script step into your second query.
Hi @Diego-mx,
It would be easy like below. Then you can apply R after that.
let Source = DimProduct in Source
Best Regards,
Dale
Hi @Diego-mx,
It would be easy like below. Then you can apply R after that.
let Source = DimProduct in Source
Best Regards,
Dale
Thanks. That wasn't that hard. 😃
Actually, I feel too much of a newbie with such simple solution, ha.
Create your Cars query. Create another query that references that query. You can then insert an R script step into your second query.