Yep, if I understand correctly then this should take care of the ordering. See comments for info:
library(tidyverse)
df <- tibble(
Item.group = c("Breast", "Breast", "Whole", "Whole", "Whole", "Breast", "Minced", "Thigh"),
Customer = c("D17", "D17", "D17", "D21", "D7", "D17", "D17", "D17"),
Date = rep(x = "2018-01-01", times = 8),
Sales = c(255, 138, 368, NA_integer_, 335, 75, 188, 118),
Campaign.flag = c(0, 0, 0, 0, 1, 0, 0, 0)
)
# Reordering the x-axis based on y values:
df %>%
group_by(Item.group) %>%
summarize(sum_sale = sum(Sales, na.rm = TRUE)) %>%
ggplot() +
# You can use reorder() for ascending sorting of values
geom_bar(aes(x = reorder(Item.group, sum_sale),
y = sum_sale), stat = "identity") +
# You might want to change the axis labels as well
xlab("Item Group") +
ylab("Sum Sales")

df %>%
group_by(Item.group) %>%
summarize(sum_sale = sum(Sales, na.rm = TRUE)) %>%
ggplot() +
# Alternatively add desc() to reverse the order
geom_bar(aes(x = reorder(Item.group, sum_sale, FUN = desc),
y = sum_sale), stat = "identity") +
xlab("Item Group") +
ylab("Sum Sales")

Separate columns per group
I'm a little less certain I know what you're looking for here, so let me know if the output below isn't what you're going for. I assumed you wanted to aggregate within Item Groups and within Dates
# Separate columns per group:
df2 <- tibble(
Item.group = c("Breast", "Breast", "Whole", "Whole", "Whole", "Breast", "Minced", "Thigh"),
Customer = c("D17", "D17", "D17", "D21", "D7", "D17", "D17", "D17"),
# Multiple dates this time
Date = c(rep(x = "2018-01-01", times = 4), rep(x = "2018-01-02", times = 4)),
Sales = c(255, 138, 368, NA_integer_, 335, 75, 188, 118),
Campaign.flag = c(0, 0, 0, 0, 1, 0, 0, 0)
)
df2 %>%
group_by(Date, Item.group) %>%
# Get summaries per date
summarize(sum_sale = sum(Sales, na.rm = TRUE)) %>%
# Go from "long" to "wide" format, filling in 0s instead of NAs
pivot_wider(names_from = "Item.group", values_from = "sum_sale", values_fill = 0)
#> `summarise()` has grouped output by 'Date'. You can override using the `.groups` argument.
#> # A tibble: 2 x 5
#> # Groups: Date [2]
#> Date Breast Whole Minced Thigh
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 2018-01-01 393 368 0 0
#> 2 2018-01-02 75 335 188 118
Created on 2021-09-01 by the reprex package (v2.0.0)