Forum Discussion

cmckinney's avatar
cmckinney
Icon for Helper IV rankHelper IV
6 years ago
Solved

Change first column in matrix to show different text value using DAX.

Basically, I have a DAX expression that is in the values field of a matrix that shows whether or not a hashed values has changed from the previously displayed date to the newer date. That explainatio...
  • Greg_Deckler's avatar
    6 years ago

    cmckinney - I think I fixed this in our other thread, sorry it took me a bit to get to it, check there and let me know. The suggestion from the other thread was:

    Measure =
      VAR __Rule = MAX([Rule])
      VAR __CurrentDate = MAX([Analysis Run])
      VAR __CurrentHash = MAX([Hash])
      VAR __PreviousDate = MAXX(FILTER(ALL('Table'),[Analysis Run]<__CurrentDate),[Analysis Run])
      VAR __PreviousHash = MAXX(FILTER(ALL('Table'),[Analysis Run]=__PreviousDate && [Rule]=__Rule),[Hash])
    RETURN
      SWITCH(TRUE(),
        ISBLANK(__PreviousDate)||__PreviousDate<0||YEAR(__PreviousDate)<1900,0,
        ISBLANK(__Rule),0,
        __Rule = "UnusedRule1",0,
        __PreviousHash <> __CurrentHash,1,BLANK(),
        2
      )