Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

PowerBI measure IF statement

Hi,  I am trying to write an IF statement where I would like my arrows to go up and down accordin to the value and change its colour at the same time. I am doing the change of colour by nesting two...
  • PhilipTreacy's avatar
    4 years ago

    Hi Anonymous 

     

    Download PBIX example with solution

     

    I'm not sure if you are using columns or measures in your IF but it doesn't matter I guess for the purposes of my example.

    What you need to do is create a measure for the value,

    _DEBT Diffs = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), UNICHAR(9660), UNICHAR(9650))

     

    and create another measure for the color.

    _DEBT Diffs Color = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), "#FF0000", "#66ff33")

     

    Then you can set conditional formatting like so

     

    Regards

     

    Phil