Forum Discussion
Recurrence Product
- 4 years ago
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)
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
Okay, I need it to filter by product code, that way it would only evaluate the date, right?
- speedramps4 years agoSuper User
Hi again Vitor_sp_bo
Report visuals have default row and column filters. In this case Product and Date.
The CALCULATE command is amazing and lets you override one or more of these default row filters.
In my example the CALCULATE command does not override the default row Product filter, but it does override the default row Date filter with the previous date. So this will only get the previous date for the same Product, because the default row Product filter is still applied. Understand now?
You can sort the visual by Product and Date and the measure will still work ok, because the measure uses the source data and not the sequence of report rows.
You can add a Product slicer but take care adding a Date slicer.
Please click the thumbs up and ACCEPT SOLUTION. Thank you
Reoccurs =
var mydate = SELECTEDVALUE('Table'[Date])
var prevdate = mydate - 1
RETURN
CALCULATE(
COUNTROWS('Table'),
'Table'[Date] = prevdate
)