Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Lookup with switch case

Table 1: consisting of Jobs:   Table 2:  Invoices of certain jobs in the job table. Not all the jobs have an invoice.       How do I calculate the Status column in the Job table usi...
  • AlB's avatar
    AlB
    7 years ago

    Anonymous

     

    Status =
    VAR _Flag =
        CALCULATE (
            MAX(Invoices[Flag]),
            FILTER(ALL(Invoices[Job ID]),Invoices[Job ID] = Jobs[Job ID])
        )
    RETURN
        SWITCH (
            _Flag,
            BLANK (), "NG",
            0, "Old",
            1, "Current"
        )