Skip to main content

I would like the ability to have the value of a reference line be based on today's date.  The primary use case I have is a Gantt Bar chart showing the timelines of various projects, where dates are along the x-axis.  I would like to add a vertical reference line to the graph to reflect today's date.  Currently, I can not find an easy way to do this. A reference line can't reference a calculated field (i.e. Today()), and parameters that reference a calculated field will not update their values automatically, even if they are originally set from a calculated field.

 

I saw a posting from 2016 which suggested adding the calculated field to Detail on the Marks card, and saying that that field should then show up as an option for a reference line when I right click on the axis, but it does not.

 

Am I missing a very obvious way to accomplish this?

 

Thanks!

3 个回答
  1. 2017年6月22日 15:23

    Denise,

     

    The post your read is correct: if you create a calculated field [Today] that is just equal to TODAY(), and then add it to the Marks shelf as a Detail, you should be able to use it as a reference line.

     

    However, to get it working properly, you may have to do 2 additional things:

     

    • Convert it to a Continuous Measure. It won't work if it's discrete (blue pill) when you add it to the Marks shelf. It must be continuous (green pill).
    • You may also find that aggregating it, such as adding it as MAX([Today]), yields more predictable results than just adding it as a row-level continuous measure.

     

    Hopefully the above will get it working for you.

0/9000