
Hello Tableau Community!
I am currently working on a Viz where we want to see the # of both Adds and Losses across the various speeds for our internet services.
I have a calculation that shows whether there was an add, loss, or no gain/loss for each month. I've used a table calculation that counts the difference from the previous period.
However, we want to see both the total number of adds and total losses each month. For example, in the screenshot below, we would like to know that there were:
- 2 total Adds in January
- 1 total Losses in January
Does anyone know of a calculation that I can use to display that?
Thanks in advance for your time and assistance.
Charlie
@Charlie Mouy Hi Charlie
Based on the sample dataset, I believe Table Calculation may not be the best option given the fact that certain account numbers only carry a single date while others have multiple dates.
I have put together a sample solution which uses LOD to calculate the count of adds and losses. Here are the steps.
Step 1
Given that references to the year, quarter and month are all strings, the first thing I did here was to combine these and turn it into a real date field.
The combined date should look like this in the crosstab.
Step 2
Then create a calculated field to set the maximum date in the range.
Step 3
Using the [Max Date] as a reference, we will create a calculated field [Count of Changes].
Place this field into the crosstab and observe the numbers are showing correctly.
Attached is a sample solution.