1 Reply Latest reply on Jul 10, 2017 12:50 PM by Patrick A Van Der Hyde

    Create Calculated Member: Make "Date" a measure (Cube Data Source)

    Camilla Hjortdam

      Hi

       

      I am Tableau newbie and trying to build my first dashboards.

       

      I am struggling a bit with working with a cube as the data source.

       

      What I want to do is to create a calculated field which automatically shows the value of today or for example current month

      For that, I would have to create a calculated field that will include "Date".

      I have done some research and the following formula would be sufficient:

      IIF(DATERUNC('month',[DateField]) = DATETRUNC('month',TODAY()),'true','false') (Formula to choose the current month )

       

      My problem is that right now, "Date" in my data is a dimension - and with cube data, one cannot use dimensions in calculated fields:

      http://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#calculations_calculatedfields_calculatedmember.html

       

       

      The solution might be making the dimension a measure by using Calculated Members.

      However, this is not really working for me - I am not experienced in MDX, so I am kind of stuck.

       

      Do any of you have suggestions to how I can work around this?

      Do any of you have had similar problems?