Case Statement Using Beast Mode Calculations

I need to create a card with one out of two solutions:

  • one chart that allows me to stack other beast mode calucations on top of one another, resembling a table; or
  • two very elaborate CASE statements that group together a dimension and measure of 17 categories.

The former does not seem to exist, so it seems I'll have to go with solution #2. The trick is that I'm using formulas to set the criteria, not just one string or numeric value.

 

I then added "IS NOT NULL" after each formula in the WHEN clause since I want the value calculated in the another Beast Mode measure* to present itself in the specific group. Here is a snippet of what I created:

 

(CASE WHEN (COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' THEN `Case Number` END))) IS NOT NULL THEN 'Disputes Received'
WHEN (COUNT(DISTINCT (CASE WHEN Stage='chargeback' AND `Lifecycle Status`='accept_liability' THEN `Case Number` END))) IS NOT NULL THEN 'Accepted'
WHEN (COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' AND `Lifecycle Status`='document_sent' THEN `Case Number` END)) + COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' AND `Lifecycle Status`='ready_to_send' THEN `Case Number` END))) IS NOT NULL THEN 'Worked'
WHEN (COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' AND `Lifecycle Status`='document_sent' AND `Disposition`='pending' THEN `Case Number` END)) + COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' AND `Lifecycle Status`='ready_to_send' AND `Disposition`='pending' THEN `Case Number` END))) IS NOT NULL THEN 'Pending'...END)

 

In short, the good news is that I see the 'Disputes Received' value when I assemble the dimension and the measure on a table. And the math is correct.

 

The bad news is that the dimension 'Disputes Received' and its value are the only the things that present itself on the table. I tried shortening the CASE statements and modifying it but nothing seems to present all 17 categories. Any tips on how to resolve this will be greatly appreciated.

*The other Beast Mode measure has the same CASE statement criteria. But instead of presenting a string such as 'Disputes Received', a formula follows the THEN clause in order to present a numeric value. For example:

 

(CASE WHEN (COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' THEN `Case Number` END))) IS NOT NULL THEN (COUNT(DISTINCT (CASE WHEN `Stage`='chargeback' THEN `Case Number` END)))...END).