KNOWLEDGE BASE

How to Show Values of a Different Category on the Specified Quarter


Published: 22 Sep 2023
Last Modified Date: 25 Sep 2023

Question

How to show the values of a different category on a specified quarter.
For example, show Furniture's profit on Q2 while show Technology's profit on other quarters.

Environment

  • Tableau Desktop

Answer

1. Create a calculation field called [Furniture(Profit)] to get the sum of the profit of "Furniture".
IF [Category]="Furniture" THEN [Profit] END

2. Create a calculation field called [Furniture(Profit)] to get the sum of the profit of "Technology".
IF [Category]="Technology" THEN [Profit] END

3. Create a calculation field [Profit (Blended)] to judge the quarters and show corresponding profits of different categories.
IF DATEPART('quarter', [Order Date])=2 THEN [Furniture(Profit)]
ELSE [Technology (Profit)]
END

4. Add [Profit(Blended)] to the view and check the results.

User-added image

Please refer to Sample.twbx for further details.
 
Did this article resolve the issue?