KNOWLEDGE BASE

Unexpected Results When Running Calculations Contain COUNTD Functions


Published: 12 Dec 2016
Last Modified Date: 23 May 2017

Issue

When using running calculations that contain CountD functions, unexpected higher results are returned.

Environment

Tableau Desktop

Resolution

To consider only once each dimension value over the time (in the below example, over the quarters), it requires to use a formula similar to :
WINDOW_SUM(COUNTD(
IF [date] = { FIXED [dimension_id]: MIN([date])} THEN [dimension_id] END),
FIRST(),0)

Cause

By design, the Running calculation will simply add the result value of each date (day, month, year, etc). Which may not be the desired behavior when using CountD calculations. 
Did this article resolve the issue?