2 Replies Latest reply on Aug 25, 2018 2:14 PM by cesar gomez

# Label A date difference Calculation Today's Date

I have a due date column. I can do a date difference calculation from Today's date. I need help on creating and output label based on the number of days left from the due date.

So as an example if I have a calculation of 6 days left I want it to be labeled Due Date Near. if Its passed the Dude Date I want it to Say OVERDUE with the Color Red.  Below are labels and color codes for each.

 On Time Green Due Date Near Yellow Late Hazard Orange OVERDUE Red
• ###### 1. Re: Label A date difference Calculation Today's Date

So I suppose That you already fixed Criteria based upon Number of days, So Create this Calc and Drag it To Color

IF (Measure)="On Time" THEN "Green"

ELSEIF

(Measure)="Due date Near" THEN "Yellow"

ELSEIF

(Measure)="Late Hazard" THEN "Orange"

ELSE

"Red"

END

Thanks

Deepak

• ###### 2. Re: Label A date difference Calculation Today's Date

I have such a simple question I am ashamed of asking I created a workbook that shows a date difference  (working days) between two dates. It creates a table with several rows with each row having a an specific total of the date difference. I want to add the totals from all the rows and divided them by the number of rows , to get an average. The average feature in Tableau seems to be off by 2.  By the chart above the sum will be 138 / its divided by the number of rows (11) giving me 12. But the average feature on tableau gives me 14  using my Validation Approval Time  measure.