Forum Discussion

jmetf150's avatar
jmetf150
Helper I
2 years ago
Solved

Only Display Latest Sequence

Goodday - I am looking for the DAX code/formula I can use to do the following.  I have a list of Open PO numbers.  Each open PO can have up to 9 different confirmation types.  Each confirmation type ...
  • Greg_Deckler's avatar
    2 years ago

    jmetf150 You can use a Complex Selector for this. The Complex Selector - Microsoft Fabric Community

    Probably something like:

    Measure =
      VAR __PO = MAX('Table'[PO])
      VAR __CurrentDate = MAX('Table'[Confirmation Date])
      VAR __MaxDate = MAXX( FILTER( ALL('Table'), [PO] = __PO ), [Confirmation Date])
      VAR __Result = IF( __CurrentDate = __MaxDate, 1, 0 )
    RETURN
      __Result
  • Greg_Deckler's avatar
    Greg_Deckler
    2 years ago

    jmetf150 No, because they don't alphabetically sort correctly. So if you had AB, P2 and E1 and got the max, it would return P2. You could create a calculated column that assigned a number such as a SWITCH statement that assigned 1 to AB, 2 to P2, etc. and that should work in lieu of a date.