Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
AdvOfJet
New Member

Issue with Power BI R Script Visual

Currently having an issue with the R script visual in Power BI. When running the graph, I can't get the format to read the entire date field - for example: 12/31/2023. Instead it breaks down the date field into Year, Quarter, Month, and Day. All of which cause issues with the visual.

 

When I run the visual in standard R I get the following.

AdvOfJet_3-1739910958498.png

 

When I run the visual in PowerBI R script, it shows the following.

AdvOfJet_2-1739910928306.png

I assume this is because of how PowerBI process date fields.

# dataset <- data.frame(Price, Year, Quarter, Month, Day, RK)

The actual columns on the table are

Price = Price offered
Ran = Date quote was ran
RK = Sales Person

I am using the following code.

library(ggplot2)
ggplot(dataset, aes(x = Year, y = Price) + geom_point()

What I can't figure out is how to make the r read the full date and plot according instead of just the year, month, or day. Using the "Ran" column name doesn't work.

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

In the Power BI settings disable Auto Date/Time for the current file and globally.

View solution in original post

Anonymous
Not applicable

Thanks for the reply from lbendlin.

 

Hi @AdvOfJet  , 

 

As lbendlin said, you can disable Auto Date/Time feature, it won't automatically generate date hierarchies. 

You can also modify the date hierarchy directly:

 vlinhuizhmsft_0-1740118078410.png

 

Re-create the visual and modify the code:

 

library(ggplot2)
dataset$Date <- as.Date(dataset$Date)
ggplot(dataset, aes(x = Date, y = Profit)) + geom_point() + scale_x_date(date_labels = "%Y")
 

vlinhuizhmsft_3-1740118658060.png

 

Result:

vlinhuizhmsft_4-1740118685316.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from lbendlin.

 

Hi @AdvOfJet  , 

 

As lbendlin said, you can disable Auto Date/Time feature, it won't automatically generate date hierarchies. 

You can also modify the date hierarchy directly:

 vlinhuizhmsft_0-1740118078410.png

 

Re-create the visual and modify the code:

 

library(ggplot2)
dataset$Date <- as.Date(dataset$Date)
ggplot(dataset, aes(x = Date, y = Profit)) + geom_point() + scale_x_date(date_labels = "%Y")
 

vlinhuizhmsft_3-1740118658060.png

 

Result:

vlinhuizhmsft_4-1740118685316.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

lbendlin
Super User
Super User

In the Power BI settings disable Auto Date/Time for the current file and globally.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.