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.

 

CaseStatusFromUntilDays
A1-New1/1/18 0:001/15/18 0:0015
A2-In Processing1/15/18 0:011/17/18 0:002
B1-New1/7/18 0:001/14/18 0:007
C2-In Processing1/14/18 0:011/20/18 0:006

 

I'd like to see how many Cases where in each Status at a given date (and hour, given the business).

 

In the example above, on 1/2/18 0:00 we only have one Case: A, in 1-New, and none in 2-Processing.

 

On 1/17/18 0:00 we have both cases in 2-Processing, and none in 1-New.

 

 

 

 

 

 

 

Basically, I need the user to filter one dane and the report to give this simple result. 

 

The problem is, I have no idea how to do that. 

 

Major thanks in advance, people.

 

Alice

  • 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)
  • 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?

6 Replies

  • Stachu's avatar
    Stachu
    Community Champion

    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)
    • AliceW's avatar
      AliceW
      Power Participant

      It partially works. Namely, it only displays the Cases for which changes were made IN that respective day :(

       

      For the rest, it's zero. 

       

      • Stachu's avatar
        Stachu
        Community Champion

        can you share more accurate data sample then?