Loading

Calculating the Year Over Year Difference of the Percent Of Total

Julkaisupäivä: Apr 13, 2024
Tehtävä

How to obtain the year over year difference of the percent of total of a measure.

Vaiheet

Option 1

Use the built-in Table Calculation by right-clicking on the desired measure and selecting Quick Table Calculation, and then selecting Year over Year Growth. 
Selecting this option will automatically convert the measure and format it into a percentage. 

Option 2

Create two calculated fields to achieve the same result: 
  1. Select Analysis > Create calculated field
  2. Name the calculated field "Percent Of Total"
  3. Enter the following formula and click OK
    SUM([Sales]) / TOTAL(SUM([Sales]))
  4. Select Analysis > Create calculated field
  5. Name the calculated field "Percent Difference"
  6. Enter the following formula and click OK
    (ZN([Percent Of Total]) - LOOKUP(ZN([Percent Of Total]), -1)) / ABS(LOOKUP(ZN([Percent Of Total]), -1))
  7. Right-click the new measure "Percent Difference" and select Format, then format the field as a percentage. 
  
Lisäresurssit
To view the above steps in action, see the video below.
Note: the video has no sound.
Types of Calculations in Tableau
Knowledge-artikkelin numero

001453693

Liitteet

YearOverYear.twbx

2354 KB

 
Ladataan
Salesforce Help | Article