I only want to return the left most value i.e., the value when the condition is met for the first time.

In the images it shows 95% 96% etc etc I only care for the column 5 where the condition of 95 is met. The percentages are calculated this way.

ROUND( RUNNING_SUM( SUM( [days_to_close_cnt] ) )/ SUM([newo_dt_cnt]),2 )

Using and the "Days to Close" gives me the column information.

The Line graph looks like this:

if [% Completed] >= .98  and  [% Completed] < 1 then INT( 98 )
elseif [% Completed] = 1  then INT(  1 )
elseif  [% Completed] >= .95  and [% Completed] < .98 then INT( 95 )
elseif  [% Completed] < .95 and [% Completed] >= .0 then INT(  0 )
end

I am using the above calculation to color in this case.

Aug 10, 2018 in Tableau 1,071 views

It looks like you are trying to tell when a running total crosses a threshold. In Tableau, doing that requires table calculations which operate on the aggregated values that have been returned from the data source.

I put together an example to illustrate how to approach this issue. Here's a static snapshot of my example:

You can define a boolean calculated field to tell whether the running total meets the threshold on a particular day and then use window_min() to calculate the first day that meets the threshold.

Table calculations are powerful, but are also the feature in Tableau that takes the most time to get your head around. So break things down and tackle them in small bites instead of trying to write complex table calculations all at once. Be aware that specifying the partitioning and addressing fields (i.e., compute using) for a table calculation is as important as writing the formula.

Also you can rewrite your Calculated field as below:

if [% Completed] < .95 then 0
elseif [% Completed] < .98 then 95
elseif [% Completed] < 1 then 98
else 1
end

I hope this helps!
• 710 points

How to export the IdP (Identity provider) XML Metadata from Keycloak which is imported to Tableau?

Keycloak version 1.6.1, Goal: Keycloak should act ...READ MORE

How to replace the count(field) which is missing in data with zero in tableau?

Use calculated field to create a dummy ...READ MORE

How to use LOD to count distinct number of records based on some condition?

From the desired output it seems that ...READ MORE

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

How interactive graphs are generated in Tableau?

Lot of back end code is shared ...READ MORE

How to determine average per event by year?

Hi Roshan, Create a new calculated field (use ...READ MORE

How to combine rows with same information in Tableau

@Ghost, Tableau has a function RANK_UNIQUE which you ...READ MORE