I need to group my customers using a criteria specified in a column but using multiple rows as condition. As an example:
| CustomerID | Status | Month |
|---|---|---|
| Customer1 | Rejected | June |
| Customer2 | Accepted | June |
| Customer2 | Rejected | June |
| Customer3 | Rejected | June |
| Customer4 | Accepted | June |
In this case, I would like to group by month and count the amount of distinct customers that were only rejected, the amount that were only accepted and the amount that where both rejected and accepted- Therefore, the expected outcome would be:
| Month | accepted & rejected | rejected | accepted |
|---|---|---|---|
| June | 1 | 2 | 1 |
Could someone help me?