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.
I am trying to plot a histogram of one of my columns using R. My code works totally fine in R but it won't work in Power BI.
Anybody knows why and how to solve this? Appreciate your help.
So I checked the data type of my "Days.Undecided", it is whole number.
Solved! Go to Solution.
@ankitpatira, in this case all the values are less than 20 so no separaters. But what you brought up is a good point! Thank you. I end up just ploting a line/bar chart directly in power BI.
if the solutions provided by other users don't work, I would recommend you run this r code on your dataframe and paste the output here:
library(gridExtra) grid.table(summary(dataset))
what it does:
Allows you to output a table from an R script to the visualisation window. The results of the "summary" function should show us what's going on.
No problem - it's saved me a fair bit of time trying to figure out the cryptic messages PowerBI gives you.
My first guess would be that your PowerBI query is referencing Days.Undecided and your R script there is calling Days_Undecided.
simple histogram winouth formating :
#Create dataframe
#dataset <- data.frame(Data1)
#Remove duplicated rows
#dataset <- unique(dataset)
hist(dataset$Data1)
@rliu Do you have any seperator in your data ie say 1,000 (',' as seperator). You will have to get rid of it and have it as pure numbers to make it work in R. I faced similar issue earier where data type in power bi was number but i had , seperator for thousands and it didn't work in R.
@ankitpatira, in this case all the values are less than 20 so no separaters. But what you brought up is a good point! Thank you. I end up just ploting a line/bar chart directly in power BI.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |