I have a set of data that shows number of tenants created on a server. My goal is to represent the same on a bar chart. Each row represents a tenant in the table. In order to get the total number of tenants on a server, create a new Calculated Field and name it “Number of Records” and set the value to
Now when you drag this measure to the column/row in Tableau, sum will show the number of tenant records on the server.
Next thing I wanted to do was to show the count of paid (non-trial) tenants on the server. The criteria for a tenant to be a paid online order is that the purchase_date in the raw will be not NULL. For this, I calculated another Calculated Field called “Is Online Order” as follows:
IF ISNULL([Purchase Date]) THEN 0 ELSE 1 END
Now, I created another Calculated Field “Total Online Orders” that would give me the sum of Online Orders as follows:
sum([Is Online Order])
Now, I can drag the “Total Online Orders” field to the Color mark and it would darken the bars that have more number of online orders and vice versa. The Tooltip on the bars will also show “Total Online Orders” in that region.