Forum Discussion
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)))
| date | id |
| 09/06/22 | 1a |
| 09/06/22 | 2a |
| 09/06/22 | 3a |
| 09/06/22 | 4a |
| 10/06/22 | 2a |
| 10/06/22 | 3a |
| 10/06/22 | 4a |
| 13/06/22 | 1a |
| 13/06/22 | 2a |
- Anonymous3 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
- amitchandak
Super User
Anonymous , Try like
CountFromPreviousDay = CALCULATE(COUNT('Check table'[UID]),PREVIOUSDAY('Calendar'[DATES))
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9check
http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/
- AnonymousNot applicable
Hi amitchandak ,
thankyou for your reply. I tried your solution. Somehow it gives fridays value for saturday as [previousday value] and monday it doesn't give a previous day value.
Regards,
Shubham
- AnonymousNot applicable
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