Can I use a column dynamically using CASE WHEN in a GROUP BY query?

You might be able to get the result you want by combining the result of two queries using UNION ALL. The exact syntax may differ (sometimes you have to select from a subquery) and you may want to specify ordering but I think this could work.

SELECT DATE,A,B,C 
FROM Table
 WHERE C = '1'
 GROUP BY DATE,A,B
UNION ALL
SELECT DATE,A,B,C 
 FROM Table
 WHERE C = '2'
GROUP BY DATE,A;

EDIT:

You can play around by adding more data and adjust the column types, names, etc. according to your needs. Here's the link to the MySql 5.7 fiddle I used to test the query. https://www.db-fiddle.com/f/gpu8cUo5wRa2Kxn86Ghjde/0

CREATE TABLE ChodingTable(SomeDate DATE, A VARCHAR(2), B INTEGER, C INTEGER);

INSERT INTO ChodingTable 
           (SomeDate,    A,  B,  C)
VALUES ('2022-01-01', 'A1', 50, 1),
       ('2022-01-01', 'A1', 50, 1),
       ('2022-01-02', 'A1', 20, 2),
       ('2022-01-02', 'A2', 20, 2);
       
SELECT SomeDate,GROUP_CONCAT(DISTINCT(A) SEPARATOR '+'),SUM(B),(C)
FROM ChodingTable
  WHERE C=1
  GROUP BY SomeDate,A
UNION ALL
SELECT SomeDate,GROUP_CONCAT(DISTINCT(A) SEPARATOR '+'),SUM(B),C
  FROM ChodingTable
  WHERE C=2
  GROUP BY SomeDate;