Forum Discussion

cheezy's avatar
cheezy
Helper I
2 years ago
Solved

column number sequence reversal

see below - data comes in from our source system as in the first two columns - for example the most recent audit for ID = 1 is 4, ID =2 is 2 and ID = 3 is 6 what i require is the sequence reversed ,...
  • rajendraongole1's avatar
    rajendraongole1
    2 years ago

    Hi cheezy -Can you please try the below code , i have checked with the above data shared 

    getting the required output as expected 

    Measure:

    Required =

    VAR MaxSequence = CALCULATE(MAX('YourTable'[Audit_Sequence]), ALLEXCEPT('YourTable', 'YourTable'[ID]))
    RETURN
    MaxSequence-MAX('YourTable'[Audit_Sequence]) +1
     

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!