How do we distinguish sales that are unprofitable? Let’s say were analysingÂ specific products across different regions like below but we want to know how **unprofitable** our sales are…

**Image 1. Sales Across Regions**

First, we want to create a **boolean calculated field** for unprofitability. Create a calculated field as below.

**Image 2. Creating a Field for Unprofitability**

We know that this is a boolean calculation because of the **=T|F** symbol next to our created field. Using this we can bring the field into the view as a marks color. However, we need to change the **calculation type** under the sales field. We do this by right-clickingÂ and choosing the **add table calculation**.

**Image 3. Adding Table Calculation**

Now we change calculation type to a percent of the total and **compute** by **specificÂ dimension**. The only field we leave checked is the **unprofitable transaction **we created earlier.

**Image 4. Computing Table Calculation**

I’ve colored the card to show red for true and grey for false values. This is great for identifying what percentage of our total sales is unprofitable.

**Image 5. Unprofitability**

I have simply reordered the unprofitability transaction card on the right to show true values at the end of the bar for better clarity.

Nice post. Using Boolean calculations is more efficient, and I think more clear, than using string valued calculations.

The one finishing touch to consider is to use an alias for the Boolean calculated field, so that the color legend can show clear labels like Profitable and Unprofitable instead of True and False. If you do, that you can also hide the title for the color legend.

Yes, definitely that would make things even clearer! Thank you!