Forum Discussion

BeginnerBI's avatar
BeginnerBI
Helper I
3 years ago
Solved

Mask specific types partially

SOS!  SOS!  SOS!  SOS!  SOS!  SOS!   Scenario: Column Type have these codes: (1,5,7,9,12,14,55)    My boss want me to mask the social and the id but partially only for the code 1,14,55    Sampl...
  • Greg_Deckler's avatar
    3 years ago

    BeginnerBI Maybe:

    Measure = 
      VAR __Value = MAX('Table'[Value])
      VAR __Type = MAX('Table'[Type])
    RETURN
      IF( 
        __Type <> 1 && __Type <> 14 && __Type <> 55,
        __Value,
        "xxx-xx-" & RIGHT(__Value,4)
      )
    
    Measure 1 = 
      VAR __Value = MAX('Table'[Value1])
      VAR __Type = MAX('Table'[Type])
    RETURN
      IF( 
        __Type <> 1 && __Type <> 14 && __Type <> 55,
        __Value & "",
        "xxxxxxxx" & RIGHT(__Value,2)
      )