Forum Discussion

Kolumam's avatar
Kolumam
Post Prodigy
7 years ago

Power BI with R Scripts, issue with scale_x_date

Hi All,

 

I have two column; Date and Water Usage. I was using ggplot to plot geom_point(), however the date is overlapped each other.

So try to use scale_x_date(date_breaks = "1 month",date_labels = "%b/%y"), however is not working due to the date format. 

 

#date format

dataset$Date_of_Cleaning__c = as.factor(dataset$Date_of_Cleaning__c)
dataset$Date_of_Cleaning__c = as.Date(dataset$Date_of_Cleaning__c,format="%d/%m/%Y")

 

I did change the date format using the code above, it shows error in seq.int(0, to0 - from, by)...

Anyone can help me to solve this issue?  

 

 

 

3 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Kolumam,

     

    Please check the date format in data view loaded into desktop. Make sure its data type is DAte rather than Date/Time, and check if its format is set to "%d/%m/%Y".

     

     

    Best regards,

    Yuliana Gu

  • Hi, I am having excaltly the same error. Is there please any updates/issues for that? 

    Thanks in adavnce