Forum Discussion
Recurrence Product
Guys, all right?
I have a dataset with 2 columns (Product Code, Date), I need to map the products that are recurring for example (today() and today()-1), the big problem is that I have 1 date per line as in the example below
| Codigo produto | Data |
| 001 | 01/02/2021 |
| 001 | 02/02/2021 |
| 001 | 03/02/2021 |
| 001 | 04/02/2021 |
| 001 | 05/02/2021 |
| 001 | 06/02/2021 |
| 001 | 07/02/2021 |
| 002 | 01/02/2021 |
| 002 | 02/02/2021 |
| 002 | 03/02/2021 |
| 002 | 04/02/2021 |
| 002 | 05/02/2021 |
| 002 | 06/02/2021 |
| 002 | 07/02/2021 |
| 002 | 08/02/2021 |
Please consider this solution and click the thumbs up icon just for me taking the effort to helping you, and click accept the solutioin if it fixes your problem. Cheers !
Reoccurs =var mydate = SELECTEDVALUE('Table'[Date])var prevdate = mydate - 1RETURNCALCULATE(COUNTROWS('Table'),'Table'[Date] = prevdate)
5 Replies
- speedramps
Super User
Please consider this solution and click the thumbs up icon just for me taking the effort to helping you, and click accept the solutioin if it fixes your problem. Cheers !
Reoccurs =var mydate = SELECTEDVALUE('Table'[Date])var prevdate = mydate - 1RETURNCALCULATE(COUNTROWS('Table'),'Table'[Date] = prevdate)- Vitor_sp_bo
Helper I
It didn't work, I need to count the products that were yesterday and today, so I need the two values to define the recurrence
- speedramps
Super User
If you create a visual table with product and date then this measure will flag any product that has a record for the previous day. I tested it ok
Reoccurs =var mydate = SELECTEDVALUE('Table'[Date])var prevdate = mydate - 1RETURNCALCULATE(COUNTROWS('Table'),'Table'[Date] = prevdate)