Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Change column attributes (DAX formula)

 

I would like to change "Type" column attributes by creating a calculated column. The "type B" is more valuable than the "type A". So, for each person in the table, if we have both types then replace them by "type B" otherwise leave it as it is.

  • Anonymous , A new column

    new column =

    var _cnt = countx(filter(Table, Table[ID] =earlier([ID]) && [Type] = "Type B") , [ID])

    return

    if(isblank(_cnt), [Type], "Type B")

2 Replies

  • Anonymous , A new column

    new column =

    var _cnt = countx(filter(Table, Table[ID] =earlier([ID]) && [Type] = "Type B") , [ID])

    return

    if(isblank(_cnt), [Type], "Type B")