Forum Discussion
swisdom
4 years agoHelper I
Calculation IF a value appears in earlier rows
I have a set of data including RMAs with various dates. I would like to create a measure which calculates if a particular Serial Number has been returned multiple times, and IF it does, to calculate ...
lbendlin
4 years agoSuper User
Thank you for providing the sample data
If multiple, Days between =
var ds=SELECTEDVALUE(RMA[Date Submitted])
var pasd = CALCULATE(max(RMA[ACTUAL_SHIP_DATE]),ALLEXCEPT(RMA,RMA[Serial Num]),RMA[ACTUAL_SHIP_DATE]<ds)
return DATEDIFF(pasd,ds,DAY)
swisdom
4 years agoHelper I
Thank you for your response!
So I can see that this is working on your pbix file, but for some reason when I apply it to my own file, it does something weird and gives values for entries that shouldn't have them (see below)
The ones highlighted in green are correct, but the rest I believe should be blank?
Any idea what is going wonky?