Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Same Assets with different Class

Hi team, need help to get the Result column. Here the requirement is, Multiple AstDep can associated with only single Asset class. For Example, {A=Fan,Pen}. Here Fan amd Pen is only for Aset class...
  • ibarrau's avatar
    4 years ago

    Hi there. If I understood correctly, then Fan and Pen are ANAmoly.

    You can build a DAX Column like this:

    Result = 
    VAR __dep = 'Table'[Dep] // current row value
    VAR __class_by_dep = // number of classes by current dep in the whole table
    CALCULATE(
        DISTINCTCOUNT('Table'[Class])
        , 'Table'[Dep] = __dep
        , REMOVEFILTERS('Table')
    )
    RETURN
    IF (__class_by_dep = 1 , "Not An", "ANAmoly")
    // If the current Dep has more than 1 class asign in the whole table, then ANAmoly

    I hope that helps,