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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Create a table based on R

Hello everybody,

 

So I am having an issue with R in Power BI because in the R script visual function. I can only put one table in each visual because the amount of rows are different. So in R I created a table that made it so all of the values within a month is summed up using this formula:


newtable <- dataset %>%
mutate(month = month(dataset$DATE, label = TRUE), year = year(dataset$DATE)) %>%
group_by(year, month) %>%
summarise(total.amt = sum(AMOUNT))

 

This would make it so they have the same amount of rows.

Now I want to make that formula into a table in Power BI. Is this possible?

I saw elsewhere to use a SUMMARIZE function but I am not familiar with how you would put an R script into it.

 

Thanks

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

Find some articles for you to check if they would help you.

https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals

https://www.thebiccountant.com/2017/08/25/tips-and-tricks-for-r-scripts-in-the-query-editor-in-power...

 

Regards,
Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

Find some articles for you to check if they would help you.

https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals

https://www.thebiccountant.com/2017/08/25/tips-and-tricks-for-r-scripts-in-the-query-editor-in-power...

 

Regards,
Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.