Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I am trying to solve the following.
I have written some R code to make a multiple line graph, and my legend contains the Dates for each line.
However, the dates have came out in the following format ...
2016-10-11 T00:00:00:00000000
How can I force the Date format to 2016-10-11 only ? I have tried changing the data type in Power BI but to no avail.
Should i be doing this in R and if so, how ?
Thanks
R Code is -
library(ggplot2)
dataset$Date <- as.factor(dataset$Date)
ggplot(data = dataset, aes(x = Speed_km.hr, y = LT_test_Lactate, colour = Date, group = Date)) +
geom_point(size = 4) +
theme_classic() +
geom_line(lwd = 2) +
ggtitle("Treadmill assessment - Blood Lactate") +
theme(axis.text.x = element_text( hjust = 1, size=20),
axis.text.y = element_text( hjust = 1, size=18),
axis.title=element_text(size=16, face="bold"),
plot.title = element_text(hjust=0.5, size=18, face="bold"),
legend.position="bottom"
) +
scale_x_continuous(limits = c(11, 18)) +
xlab('Speed') +
ylab("Blood Lactate (mM)") +
geom_hline(yintercept = 4, linetype = "dashed", lwd = 1.3, colour = "grey")
Solved! Go to Solution.
You may try using FORMAT Function to add a calculated column.
You may try using FORMAT Function to add a calculated column.
Greetings, can you please paste the code you have used. I am also trying to implement a dual y-axis chart with one x-axis and different legends. Below would be my ideal requirement
col1 acts x-axis
col2 acts y1-axis
col3 acta y2-axis
col4 has some names (name1, name2, name3, name4) the col4 should acts a legend. I know that there is a limitation in power bi, but is there a way I could do this using ggplot. Below is my ideal graph expecting on power bi.
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |