Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Creating calculated column with blanks and number comparison

I have a column of "Target" values with some blank rows and a measure calculation "Measure1" based off other columns. I want to create a new column "Value Color" that compares the Measure1 to the Tar...
  • vanessafvg's avatar
    3 years ago

    better to do a switch statement ie.

    ValueColor =
    SWITCH (
    TRUE (),
    ISBLANK ( 'Table'[Target] ), BLANK (),
    [Measure1] > SUM ( 'Table'[Target] ), "#31991a",
    [Measure1] <= SUM ( 'Table'[Target] ), "#ff4a4a",
    BLANK ()
    )