Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Unable to get date ranges using firstdate

Hi, I have a manually created table where the user will pick from a drop down

 

 

I want it to get the correct starting date, depending on what the user clicks on above
In the example above, when I click All Data, the first date in the table appears.
But when I click on any other option here, the card on the right comes up blank.  Here's the code I'm using

_1 Start Date =
SWITCH (
   SELECTEDVALUE('_CalendarOptions'[Options]),
   "All Data", MIN('SingleMultiPageVisits'[MetricDate]),
   "Last Month", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -2, MONTH)),
   "This Month", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -1, MONTH)),
   "Last Year", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -1, YEAR)),
   "Year Before That", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -2, YEAR))
)

Needless to say, I have no idea why this isn't working for the rest of the options.
Would appreciate any help?
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

    This is a table visual not a slicer:

    When you select the content in the table visual, It will only act as a highlight, without any filtering effect. Please change the table visual into a slicer.


    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    This is a table visual not a slicer:

    When you select the content in the table visual, It will only act as a highlight, without any filtering effect. Please change the table visual into a slicer.


    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks. I forgot all about that.