Forum Discussion

manishsalanke's avatar
manishsalanke
Helper II
3 years ago
Solved

conditional column for different entity

hi , community we have a conditon in which we need to create a calulated column using dax for vendor ,agent ,party .we have to create a bucket for agent ,party and agent      need ...
  • tamerj1's avatar
    tamerj1
    3 years ago

    manishsalanke 
    I Suppose you have that column in the main table and you have 3 lists (vendor ,agent ,party) in 3 separate tables. As follows:
    'Table'[Column]
    Vendors[Vendor]
    Agents[Agent]
    Parties[Party]

    The new column would be

    NewColumn =
    SWITCH (
        TRUE (),
        'Table'[Column] IN VALUES ( Agents[Agent] ), "Agent",
        'Table'[Column] IN VALUES ( Vendors[Vendor] ), "Vendor",
        'Table'[Column] IN VALUES ( Parties[Party] ), "Party"
    )