Showing results for 
Search instead for 
Did you mean: 

R Script Error: Package or namespace load failed for 'tidyverse': .onLoad....



Currently unable to resolve the error message below when attempting to refresh my desktop PBI report file. 



I have the following installed on my cpu:



The following R- Script is used in my PBI report:


regx_0 <-'([0]{6,}\\d{1})'
regx_9 <-'([9]{6,}\\d{1})'

# Only selecting distinct Material Numbers
dataset <- dataset %>% distinct(`Material Number`)

# Filtering data to records with valid Material Numbers (fewer than 8 digits after decimal)
data_clean <- dataset %>% filter(!str_detect(`Material Number`,'\\.\\d{8,}$'))
data_clean <- data_clean %>% mutate(Material_Number_Clean = `Material Number`)

# Filtering data to invalid records (Material Number > 8 digits after decimal)
data <- dataset %>% filter(str_detect(`Material Number`,'\\.\\d{8,}$'))


# Identifying if floating points are a bunch of 0's or 9's
data00 <- data %>% filter(str_detect(`Material Number`, regx_0))
data99 <- data %>% filter(str_detect(`Material Number`, regx_9))


# If 0's just strip off the floating points
data00 <- data00 %>% mutate(Material_Number_Clean = str_replace(`Material Number`,regx_0,''))


# If 9's, round up one decimal place
data99 <- data99 %>% mutate(Material_Number_Clean = str_replace(`Material Number`,regx_9,''))
data99 <- data99 %>% mutate(round = str_replace_all(Material_Number_Clean,'[0-9]','0'))
data99 <- data99 %>% mutate(round = str_replace(round, '0$','1'))
data99 <- data99 %>% mutate(Material_Number_Clean = as.character(as.numeric(Material_Number_Clean) + as.numeric(round)))
data99 <- data99 %>% select(-round)


# Union clean data, 0's data, and 9's data together
OUT <- bind_rows(data_clean, data00, data99)



Hi @bbui11 ,


The most current version of R supported on both Power BI Desktop and the Power BI service is version 3.4.4

Please also refer to the package versions supported by Power BI Service.

Create visuals by using R packages in the Power BI service 



If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Kudoed Authors
Users online (2,563)