Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using R to transform data from an azure live connection

Hello,

 

I'm aware of the functionality to run R script in the query editor, however I can't find any documentation about using it in conjunction with a live connection. I'm not sure it's even possible to do so.


For example in situations where I need a measure as a column in a matrix or I want to filter based on a measure.

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous ,

 

that you do not find any documentation on using R the way you want, is due to the fact that it's simply not possible.

 

There are just these two inception points for R (this is also valid for python):

  • R and Power Query
    Here it's possible to use R scripts as a data source or during data transformation. Either the input/output must be a table (an R data.frame type)
  • R script visual
    Here are scripts can be used to visualize data, e.g., using the package ggplot2 

Using R inside Power Query means that the R script will only be executed during data refresh.

Using R for data visualization means that there are more script executions, but this can only be leveraged for data visualization, as the filtered table (by all the other user interactions) will feed the R script.

 

It's not possible to use R (or python) for anything between the above-mentioned scenarios, like using R inside a DAX statement creating a measure, or even a calculated column.

 

Hopefully, this provides some additional insights, even if it's not a solution for your task.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @Anonymous ,

 

that you do not find any documentation on using R the way you want, is due to the fact that it's simply not possible.

 

There are just these two inception points for R (this is also valid for python):

  • R and Power Query
    Here it's possible to use R scripts as a data source or during data transformation. Either the input/output must be a table (an R data.frame type)
  • R script visual
    Here are scripts can be used to visualize data, e.g., using the package ggplot2 

Using R inside Power Query means that the R script will only be executed during data refresh.

Using R for data visualization means that there are more script executions, but this can only be leveraged for data visualization, as the filtered table (by all the other user interactions) will feed the R script.

 

It's not possible to use R (or python) for anything between the above-mentioned scenarios, like using R inside a DAX statement creating a measure, or even a calculated column.

 

Hopefully, this provides some additional insights, even if it's not a solution for your task.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

I assumed this to be the case, I just couldn't find anywhere that definitively gave the answer. Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.