Is this in a pivot table? The problem is you have some entries on your data without a value in Dept.
It would be best to fix this in the source data or in the load script if that is not possible. I you must fix it in the front end, then you will not be able to use Dept as a dimension. You could use it as an expression (eg Concat(Dept, ',')), but you will get a column for each quarter.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
It looks like data coming from different source and combined manually. It always better to clean data before we try to apply analytical functions and representation. Please share your data model to clarify things as others also suggested. Thanks.