Skip to main content

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?

 

Calculation Showing Total Adds and Losses 

Thanks in advance for your time and assistance.

 

Charlie

2 个回答
  1. 2024年2月28日 23:48

    @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.

    @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 mulImage 02Image 03The combined date should look like this in the crosstab.

    Image 04 

    Step 2

    Then create a calculated field to set the maximum date in the range.

    Image 05 

    Step 3

    Using the [Max Date] as a reference, we will create a calculated field [Count of Changes].

    Image 06 

    Place this field into the crosstab and observe the numbers are showing correctly.

     

    Image 07 

    Attached is a sample solution.

0/9000