Forum Discussion

AliceW's avatar
AliceW
Power Participant
7 years ago
Solved

Snapshot for a given date

Hi folks,   This is such an important topic for me, so help a girl out, please.   So, I have, say, 2 support cases, which have gone through different statuses in different dates.   Case Sta...
  • Stachu's avatar
    7 years ago

    you need separate Calendar table that would have all the dates
    if you don't have one you can create it with this sytnax (adjust the dates properly)

    Calendar = CALENDAR(DATE(2018,1,1),date(2018,12,31))

    this table it should have NO active joins to you data table
    then this syntax should work (in the visual use date from Calendar table)

    Measure = 
    VAR ShownDate = MAX('Calendar'[Date])
    VAR RelevantRows = FILTER('Table','Table'[From]<=ShownDate+1 && 'Table'[Until]>=ShownDate)
    RETURN
    COUNTROWS(RelevantRows)
  • Stachu's avatar
    Stachu
    7 years ago

    so this is the sytnax I have with adjusted names:

    Measure = 
    VAR ShownDate = MAX('Calendar'[Date])
    VAR RelevantRows = FILTER('Table','Table'[Change Date]<ShownDate+1 && 'Table'[Change Valid Until]>=ShownDate)
    RETURN
    COUNTROWS(RelevantRows)

    I cannot see what is working wrong here - can you specify which Enhancement Number has the data that shows the issue?