Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Letting user set date variable for calculated measures

Hi,

 

Please can you tell me how to allow a user to set a date variable (on a report page) which will then be used by a calculated measure?

 

I tried clicking on "New Parameter" expecting to see an option to enter a date but there doesn't appear to be such an option?:

 

 

Thanks,

 

CM

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I found a workaround. Just set the parameter up as a whole number, then find the parameter's field in the list of data tables and change the data type to date. That seems to change the parameter slicer to accept dates.

  • I use a slicer for dates and allow them to pick a single date or a date range. That value then becomes the selected value for the measure.  

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi JoyCornerstone, thanks - is that a normal slicer or a parameter slicer? How did you set the data type to "date"?

      • JoyCornerstone's avatar
        JoyCornerstone
        Resolver II

        A normal slicer.  In your data model, you should have a Calendar table that contains a date range for the set of dates in your system.  If you don't have that, you'll need to go search for how to set that up and connect it to your underlying table.