Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Slicer Week/Month formula

Hi all, Could you please help me with a dax formula, which I can use for Chliclet Slicer connected to a lince chart. The slicer has 4 options: 1 week, 2 weeks, 3 weeks, 1month. If 1 week is select...
  • Greg_Deckler's avatar
    6 years ago
    I would have you measure only return values within the specified range, so

    VAR __MinDate =
    SWITCH([Slicer],
    "1 Week",TODAY() - 7,
    "2 Weeks",TODAY() - 14,
    ...
    )
    VAR __Date = MAX([Date])
    RETURN
    IF(__Date >= __MinDate,[measure calc],BLANK())