Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Check if date slicer is consecutive

I have a date slicer made using date heirarchy (Year, Quarter, Month) from a date table, and I need to have a way to check if the selected values from the date slicer are consecutive.   If the date...
  • Anonymous's avatar
    Anonymous
    4 years ago

    That sounds.... Disgusting. Thankfully after some food I had an epiphany ğŸ˜… This will all be dependant on the values chosen in the Date Hierarchy slicer

     

    Test = 
    VAR MinDate = MIN(Calendar[Date])
    VAR DisMon = DISTINCTCOUNT([Date].[Month])
    VAR NewDate = DATE(YEAR(MinDate),MONTH(MinDate)+DisMon,DAY(MinDate))
    VAR MaxDate = Max(Calendar[date])+1
    Return NewDate=MaxDate