Hi,
It seems that your data format not recognized correctly if you use Power BI Service. Please refer code functions to convert these date values :
library(ggplot2)
dfr <- dataset
dfr$day <- factor(strftime(as.POSIXlt(dfr$Date,format = "%Y-%d-%m"),format="%A"),levels=c("Sunday","Saturday","Friday","Thursday","Wednesday","Tuesday","Monday"))
dfr$week <- factor(strftime(as.POSIXlt(dfr$Date,format = "%Y-%d-%m"),format="%V"))
dfr$month <- factor(strftime(as.POSIXlt(dfr$Date,format = "%Y-%d-%m"),format="%B"),levels=c("January","February","March","April","May","June","July","August","September","October","November","December"))
dfr$ddate <- factor(strftime(as.POSIXlt(dfr$Date,format = "%Y-%d-%m"),format="%d"))
# plot
p <- ggplot(dfr,aes(x=week,y=day))+
geom_text(aes(label=paste(ddate,sep ="
")))+
scale_fill_manual(values=c("#8dd3c7","#ffffb3","#fb8072","#d3d3d3"))+
facet_grid(~month,scales="free",space="free")+
labs(x="Week",y="")+
theme_bw(base_size=12)+
theme(legend.title=element_blank(),
panel.grid=element_blank(),
panel.border=element_blank(),
axis.ticks=element_blank(),
strip.background=element_blank(),
legend.position="top",
legend.justification="right",
legend.direction="horizontal",
legend.key.size=unit(0.4,"cm"),
legend.spacing.x=unit(0.3,"cm"))
plot(p)
Hope This Helps!!
Ready to elevate your data skills? Dive into our Power BI Course Content and embark on a transformative learning journey designed for data enthusiasts, analysts, and business intelligence professionals!