Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Identification Record Check

Hello   I have a table which consists of IDs that have two record types (blue or yellow). I want to create a calcualted column that does the following:   If ID has 'Blue' & 'Yellow' record state ...
  • johnt75's avatar
    4 years ago

    You can create a calculated table like

    Table 2 = 
    var allBlue = CALCULATETABLE( VALUES('Table (2)'[ID]),'Table (2)'[Record] = "Blue")
    var allYellow = CALCULATETABLE( VALUES('Table (2)'[ID]),'Table (2)'[Record] = "Yellow")
    return UNION( 
        GENERATE( INTERSECT( allBlue, allYellow), { "Complete" }),
        GENERATE( EXCEPT( allBlue, allYellow), { "Blue" }),
        GENERATE( EXCEPT( allYellow, allBlue), { "Yellow" } )
    )