Show Date Range in Label or Insight based on Date picker

here is the requirement

  1. I have a Date picker say ‘Period’
  2. I want to show a label/text or insight below the date picker which says
    "Data seen is in the range [selected date] to [selected date - 12 months] "

Hi Harsha,
There are a couple of ways to accomplish this. Below is one way using a parameter driven control and an insight to display the text you need:

  1. Create a data parameter (pDate) and a date picker control for it.
  2. Create an insight, customize it and apply the following code block to it:
    Data seen is in the range formatDate(${pDate}, ‘yyyy-MM-dd’) and formatDate(addDateTime(-12, ‘MM’, ${pDate}), ‘yyyy-MM-dd’)

Hope this helps.