Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Get count of previous date value.

Hey guys,

How to get the value count for a column for previous day and plot it in clustered column chart?

CountFromPreviousDay = CALCULATE(COUNT('Check table'[UID]),FILTER('Calendar',PREVIOUSDAY('Calendar'[DATES)))
I have a calendar table with all the dates and a check table with [Date] and [ID] column. I have ID incoming everyday except saturday and sunday. using the upper dax skips previous values for monday and friday. What is the ideal dax for this ?
 [Calendar Table] : has all dates
[CHECK TABLE] : skips sat and sun
dateid
09/06/221a
09/06/222a
09/06/223a
09/06/224a
10/06/222a
10/06/223a
10/06/224a
13/06/221a
13/06/222a
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Create an index column:

    index = RANKX('Table','Table'[date],,ASC,Dense)

    Then create a measure like below:

    Measure = CALCULATE(COUNT('Table'[id]),FILTER(ALLSELECTED('Table'),'Table'[index]=SELECTEDVALUE('Table'[index])-1))+0

     

     

3 Replies