Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

UNION Related filter

Hello,    I have a problem in applying filter from related table, from 1 side of relationship. 'prod'[serial] = "true"   Total Rules =     UNION(     SELECTCOLUMNS(         'Cons',         ...
  • tamerj1's avatar
    3 years ago

    Hi Anonymous 

    please try

    Total Rules =
    VAR T =
    FILTER ( 'Cons', RELATED ( 'prod'[serial] ) = "true" )
    RETURN
    UNION (
    SELECTCOLUMNS (
    T,
    "ID", 'Cons'[Id],
    "Name", 'Cons'[Name],
    "Rules", "V_1",
    "WO", 'Cons'[Work],
    "Errors", 'Cons'[V_1]
    ),
    SELECTCOLUMNS (
    T,
    "ID", 'Cons'[Id],
    "Name", 'Cons'[Name],
    "Rules", "V_2",
    "WO", 'Cons'[Work],
    "Errors", 'Cons'[V_2]
    )
    )