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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jaryszek
Super User
Super User

Adding R code bug

hi Guys,

I am getting:

jaryszek_0-1748603281663.png


after implementing this R code:

jaryszek_1-1748603306515.png


why ? what is happening with my bpip project file?

 full error details:
https://sharetext.io/75f510ff 

Best,
Jacek

 




Best Wishes,
Luke Jarych

From data chaos to business clarity — let’s connect and solve data challenges together.
LinkedIn Connect with me on LinkedIn
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jaryszek,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Please find below documentation link to get data from R script

Run R scripts in Power BI Desktop - Power BI | Microsoft Learn

 

Try this code:

env_value <- Sys.getenv('COSTMGMT_CONFIG_SOURCE_PATH')
df <- data.frame(Path = env_value)
df

 

If this information was helpful, kindly mark the response as accepted and give it a thumbs-up, so it may assist others as well.

 

Best regards,
Prasanna Kumar

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @jaryszek,


Just a gentle reminder has your issue been resolved? If so, feel free to share the solution that worked for you, or let us know if you found a different fix.

This helps close the loop on your query and supports others in the community who might face similar challenges.

Thank you for your time and feedback!

Best regards,
Prasanna Kumar

Anonymous
Not applicable

Hi @jaryszek,

 

We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

 

Warm regards,

Prasanna Kumar

Anonymous
Not applicable

Hi @jaryszek,

 

Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

 

Best regards,

Prasanna Kumar

Anonymous
Not applicable

Hi @jaryszek,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Please find below documentation link to get data from R script

Run R scripts in Power BI Desktop - Power BI | Microsoft Learn

 

Try this code:

env_value <- Sys.getenv('COSTMGMT_CONFIG_SOURCE_PATH')
df <- data.frame(Path = env_value)
df

 

If this information was helpful, kindly mark the response as accepted and give it a thumbs-up, so it may assist others as well.

 

Best regards,
Prasanna Kumar

Anonymous
Not applicable

Hi @jaryszek,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.


The issue arises because R script code was manually inserted into the .tmld file of your Power BI Project (PBIP), which is not the correct or supported way to integrate R in Power BI. This causes the error "Multiple SaveChanges without transaction" due to inconsistent or invalid metadata edits. To resolve the issue, remove the manually added R.Execute code from the .tmld file, and instead add your R script using the “Get Data > R Script” option within Power BI Desktop. This ensures that Power BI handles the metadata and transactional integrity correctly. If the project remains corrupted, revert to a previous working version of the PBIP project.


If this information was helpful, kindly mark the response as accepted and give it a thumbs-up so it can assist others as well.

 

Best regards,
Prasanna Kumar

What should be a format for my query then?

Source = R.Execute(
"env_value <- Sys.getenv('COSTMGMT_CONFIG_SOURCE_PATH')
df <- data.frame(Path = env_value)
output <- list(df = df)",
null
),

Best Wishes,
Luke Jarych

From data chaos to business clarity — let’s connect and solve data challenges together.
LinkedIn Connect with me on LinkedIn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.