Loki12
Loki12

Reputation: 1

Power Bi Variable query

I’m trying to calculate it so Power BI will check the value of the Outcome column in one power bi table (the CSV File 2025 table). If the value is "LATE" or "FAILED," it will look up the corresponding Container value from a second power bi table (the CSV File Incident Log 2025 table) – where there might be duplicate values. Otherwise, it will return the original Outcome value.

Currently, I’m using the below formula, but it keeps on retuning a syntax error no matter what alteration I make.

the 'CSV File 2025'[Outcome] is a column that has multiple values (words) in it, so I can see why this would error, but I'm not sure how to get around this

could anyone help please, thanks in advance!

NewOutcomeColumn =
VAR OutcomeValue = 'CSV File 2025'[Outcome]
RETURN

SWITCH(
    TRUE(),
    OutcomeValue = "LATE", LOOKUPVALUE('CSV File Incident Log 2025'[Container], 'CSV File Incident Log 2025'[Outcome], "LATE"),
    OutcomeValue = "FAILED", LOOKUPVALUE('CSV File Incident Log 2025'[Container], 'CSV File Incident Log 2025'[Outcome], "FAILED"),
    OutcomeValue
)

Upvotes: 0

Views: 20

Answers (0)

Related Questions