Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Comparing rows in same table to verify what value has changed

Hi I have researched for an answer to this problem but yet to find the right answer.   I have a dataset with columns, ID, Date, Development Type, Delivery Term and would like to see what data ha...
  • HotChilli's avatar
    5 years ago

    This will give you a column of the previous value:

    DiffFromPrvWeek = VAR _id = TablePrj[ID]
    VAR _term = TablePrj[Delivery Term]
    VAR _date = TablePrj[Date]
    RETURN
    CALCULATE(MIN(TablePrj[Delivery Term]), FILTER(ALL(TablePrj),  TablePrj[ID] = _id && TablePrj[Date] = _date -7))

    You can use it to create another column to signal a difference (from delivery term) or use an IF statement within the formula.