Forum Discussion
Find previous record - Help
- 6 years ago
Hi Anonymous
If my previous reply helped you, could you kindly accept it as a solution so people may find the solutions quickly?
If the problem still exists, please check the workarounds below:
Create calcualated columns below:
repeated = VAR re = CALCULATE ( COUNT ( 'Table 2'[Issue] ), FILTER ( 'Table 2', DATEDIFF ( 'Table 2'[Date], EARLIER ( 'Table 2'[Date] ), DAY ) <= 5 && 'Table 2'[Date] <= EARLIER ( 'Table 2'[Date] ) ) ) RETURN IF ( re > 1, "Yes", "No" ) previous record = CALCULATE(MAX('Table 2'[Issue]),FILTER('Table 2','Table 2'[Date]<EARLIER('Table 2'[Date]))) cause a repeat = VAR c = CALCULATE ( MAX ( 'Table 2'[previous record] ), FILTER ( 'Table 2', 'Table 2'[repeated] = "Yes" ) ) RETURN IF ( [Issue] = c, c, "No" )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
When you extract, try extracting additional columns. You would then be able to compare the prior record's columns to the current record's columns with an add column. You would not have to perform additional lookups.
Also, I would be wary of using the technique in the video. PowerBI behavoir only guarantees a sort order if Sort is the last step within a query OR you issue a Table.Buffer after the Table.Sort.
Regards,
Mike