Weird Behavior in Group_By

I have a custom R visualization within Power BI. The visualization works fine in my own Power BI Desktop but I am noticing some weird behavior when uploading the dashboard to Power BI Services.

When I group by a column the data such as:

dataset = dataset %>%
group_by(month, year, groupname) %>%
summarize(y = cumsum(y))

it is not grouping correctly. The groupname column will start with two different values to group, lets say "A" and "B" but when I group the data the output will be the "B" column and a bunch of different numbers like "0", "12", "2" , etc... with NA values. The whole dataset seems to be messed up. Other columns like the month and year now reading as NA instead of their original values.

There are other columns I use this same behavior on within the data.frame and these seem to group correctly except for this one. I am not sure what is causing this behavior.

Does anyone know a different approach I can use to do a group_by than with dplyr and see if it makes a difference?

I think you will need to post a reproducible example in order for us to be able to help you effectively. Maybe you could just sample a few rows from your actual data set since it's very likely that the problem is with your data.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.