How do I create a measure to describe the status between two other measures?

Viewed 21

I have two measures [Inv Qty] and [Sold Qty]. Sold is not yet shipped, meaning Inventory isn't reduced yet. So we want to be able to state whether or not we have enough inventory to meet the demand of what we've sold. I have this measure, but when I add it to a table visualization, it take several minutes to load and the gives a "not enough memory error". I expect like the rest of the report that it should take a second or less. What am I doing wrong ?

Status = 
    SWITCH(
        TRUE(),
        [Inv Qty]>=[Sold Qty],"Full",
        [Inv Qty]>0,"Partial",
        "Zero"
    )

I've also tried nested IF statements, as follows:

Status = IF([Inv Qty]>=[Sold Qty],"Full",IF([Inv Qty]>0,"Partial","Zero"))
1 Answers

I ended up created a new Column instead of a Measure. This solved the issue.

Related